Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

C & C++ init values

Name: Anonymous 2006-05-01 20:56

Why do all the members of a class are initialized with the value 0 by default? Is it a feature of g++ or is it written in the language? I thought it was undefined (and often "random"). I have the same thing happening with a C program and remember it was not the case on some BSDs systems.

Name: Anonymous 2006-05-01 21:06

For security, an OS will never give you crap data. It'll be all initialized to 0; however don't count on it.

Name: Anonymous 2006-05-02 3:26

My g++ 4.0.2 on linux will show randomness when I just compiled and ran an int I created with no initial value.

Name: Anonymous 2006-05-02 4:19

>>1
It MAY initialize to 0, but is not guaranteed and should not be relied on.

Name: Anonymous 2006-05-02 7:34

I believe you can disable blanking in Windows NT for like 0.01% more performance (VROOM VROOOM!).

Name: Anonymous 2006-05-02 9:09

0xDEADBEEF

Name: Anonymous 2008-07-12 16:09


 +-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+
 |T|h|o|s|e| |a|r|e| |s|t|u|p|i|d| |L|I|S|P|-|f|a|g| |q|u|o|t|e|s|!|
 +-+-+-+-+-+ +-+-+-+ +-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+

Name: Anonymous 2010-06-07 6:37

Hi, I can spam /prog/ too, you faggot.

Also, smoke weed everyday.

Name: Anonymous 2010-11-14 6:57

Name: Anonymous 2011-01-31 19:53

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List