472,782 Members | 1,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,782 software developers and data experts.

A paragraph from Bjarne stroustrup's Book

7
How to understand the following paragraph from Bjarne stroustrup's The C++ Programming Language?
9.4.1:
In principle, a variable defined outside any function (that is, global, namespace, and class static variables) is initialized before main() is invoked. Such nonlocal variables in a translation unit are
initialized in their declaration order (10.4.9). If such a variable has no explicit initializer, it is by default initialized to the default for its type (10.4.2). The default initializer value for builtin types and enumerations is 0 . For example:

Does it mean:
class Example
{
static int DataMember;
}
DataMember automatically intialized to 0.
This seems to be wrong.
Feb 15 '08 #1
1 1743
weaknessforcats
9,208 Expert Mod 8TB
Youe have just declared a static member variable but you haven't defined it.

When you define it, the default initialization will be 0.

You might read this: http://www.thescripts.com/forum/thread737451.html.
Feb 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Teddy | last post by:
Hello all Bjarne Stroustrup says "The most important thing to do when learning C++ is to focus on concepts and not get lost in language-technical details" and "Focus on programming techniques,...
3
by: devser2006 | last post by:
Do You Want The Book C++ Programming Language By Bjarne Stroustrup? If yes , please download a screensaver from http://www.geocities.com/screensaver_200and email me that you have downloaded the...
1
by: Mike | last post by:
Hi, I'm auctioning the book "The C++ Programming Language" 3rd Ed. by Bjarne Stroustrup on ebay, details as follows or see eBay item number 250030480853. Softback. Condition : Good. Pub....
17
by: CoreyWhite | last post by:
I bought this book years ago, when I was just learning C++. Since then I've gone through every math course offered at my college, taken courses on coding C & thinking in terms how how to make the...
2
by: Rakesh UV | last post by:
Hi, I searched on google for this book "The c++ programming language by Bjarne Stroustrup's" but i diidnt get any which is free, Thanks in advance Rakesh UV
20
by: gremlin | last post by:
http://www.cilk.com/multicore-blog/bid/6703/C-Inventor-Bjarne-Stroustrup-answers-the-Multicore-Proust-Questionnaire
0
by: gremlin | last post by:
http://www.cilk.com/multicore-blog/bid/6703/C-Inventor-Bjarne-Stroustrup-answers-the-Multicore-Proust-Questionnaire
1
by: blangela | last post by:
Bjarne Stroustrup has a new text coming out called "Programming: Principles and Practice Using C++" (ISBN: 0321543726), due to be published in December of this year. Some of the features of this...
3
by: HL | last post by:
As the subject, I like the font he used for codes. It's not constant- width but better than constant-width fonts while presenting text. Netters, could you tell me the name of that font? I hope to...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.