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

How to understand the following paragraph from Bjarne stroustrup's The C++ Programming Language?
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
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

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,...
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...
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....
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...
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
by: gremlin | last post by:
by: gremlin | last post by:
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...
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...
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...
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...
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...
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...
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 ...
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...
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=()=>{
by: lllomh | last post by:
How does React native implement an English player?
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.