473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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

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
6 2277
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Steven T. Hatton | last post by:
I'm still not completely sure what's going on with C++ I/O regarding the extractors and inserters. The following document seems a bit inconsistent:...
6
by: John Baker | last post by:
Hi: Does "On Open" code execute before or after related data is loaded? I want to test before the form appears on the screen to see if there is any data in the queryresult, and if there is not...
1
by: John Bailo | last post by:
using ( SqlCommand cmd = new SqlCommand("select * sample"), new SqlConnection( sqlDsn ) ) ) { SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataTable dt = new DataTable();...
1
by: DougFAI | last post by:
Hello there. Today, I was developing a college work software and then I saw thoe 2 types of while. My teacher asked me how does the "while(ifs)" (considering my ifstream was ifs) (that was the one...
4
by: jaime | last post by:
Hi again all. Given the line: const int x=5; Can I then use "x" as a constant expression? (By "constant expression", I mean "constant expression" as defined in the C99 standard) I've been...
3
by: dvanderwel | last post by:
I have a .NET 1.1 web page with a DataGrid containing a TemplateColumn that contains a DropDownList. I need to fire an event when the selected item in the DropDownList changes for the current...
1
by: Curious | last post by:
I have the following code: if (this.InvokeRequired) { IAsyncResult result = this.BeginInvoke(new EventHandler(this.UpdateButtons), new object { this, EventArgs.Empty }); while...
4
by: lander | last post by:
I've read the page life cycle thing in msdn, still, i'm getting a bit confused of thinking how all the things are going under the hood... I know that when page loading, that the controls'...
9
by: erictheone | last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.