[prog] [C] strings bug

Robert J. Hansen rjh at sixdemonbag.org
Thu Apr 10 08:05:49 EST 2003


> When this function is called, the values of string1, string2, and string3 are 
> undefined - they could technically be anything. Looking at your output, 

According to C++98, globals are initialized to a value of 0 (NULL for
pointers, 0.0 for doubles/floats) before main() is entered.  I believe
C89 is the same way, but I wasn't able to find a definitive reference in
a thirty-second check of K&R.

-- 
Robert J. Hansen <rjh at sixdemonbag.org>



More information about the Programming mailing list