By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

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

P: n/a
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


Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
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.

Jul 19 '05 #2

P: n/a
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
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.

Jul 19 '05 #3

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

"Alf P. Steinbach" <al***@start.no> a écrit dans le message de news:
3f****************@News.CIS.DFN.DE...
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
I have seen this syntax and would like to know weither var_name is entirelyfilled 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.

Jul 19 '05 #4

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

"Alf P. Steinbach" <al***@start.no> a écrit dans le message de news:
3f****************@News.CIS.DFN.DE...
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
I have seen this syntax and would like to know weither var_name is entirelyfilled 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.

Jul 19 '05 #5

P: n/a
On Sun, 10 Aug 2003 11:28:11 +0200, "Fred" <da**********@free.fr> wrote:

[Don't top-post. Rearranged]
"Alf P. Steinbach" <al***@start.no> a écrit dans le message de news:
3f****************@News.CIS.DFN.DE...
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
>I have seen this syntax and would like to know weither var_name isentirely >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.


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


[http://dmoz.org/Computers/Programmin...++/Standards/]
Jul 19 '05 #6

P: n/a
On Sun, 10 Aug 2003 11:28:11 +0200, "Fred" <da**********@free.fr> wrote:

[Don't top-post. Rearranged]
"Alf P. Steinbach" <al***@start.no> a écrit dans le message de news:
3f****************@News.CIS.DFN.DE...
On Sun, 10 Aug 2003 10:47:02 +0200, "Fred" <da**********@free.fr> wrote:
>I have seen this syntax and would like to know weither var_name isentirely >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.


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


[http://dmoz.org/Computers/Programmin...++/Standards/]
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.