does "struct_name var = { 0 }; " fill var with 0?

F

Fred

I have seen this syntax and would like to know weither var_name is entirely
filled with zeroes or only a first few bytes are zeroed (for example the
first field of the structure).

I have of course tried it with MSVC and it seemed to fill the entire
structure, but is this the norm? Where can I find more informations?

thanks in advance,
Fred
 
A

Alf P. Steinbach

I have seen this syntax and would like to know weither var_name is entirely
filled with zeroes or only a first few bytes are zeroed (for example the
first field of the structure).

I have of course tried it with MSVC and it seemed to fill the entire
structure, but is this the norm?
Yes.


Where can I find more informations?

The C++ standard.
 
F

Fred

Thanks for such a fast answer. Do you have a good online source for
occasionnaly reading the norm?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,139
Messages
2,570,805
Members
47,351
Latest member
LolaD32479

Latest Threads

Top