Henri Verbeet wrote:
2009/6/30 Daniel Santos javatroubadour@yahoo.com:
Some pointers are getting used prior to initialization. It would appear that the current compilers are initializing them to zero or we've been lucky.
No, the C standard specifies that these are initialized to NULL, since they have static storage duration.
We are assuming that the c compilers are following the standard. I was told a long time ago, 1994 to be exact, that if we want to insure that a variable has a certain value to initialize it to that value. This applies if we want a zero or a NULL.
[code]
int a = 0; char b = NULL; bool c = TRUE;
[/code]
Without this, we cannot assume anything.
James McKenzie