Just as a heads up, some debuggers (such as Visual Studio) will complain if you use uninitialized variables.
Actually, the debugger just catches the crash and identifies that it happend through an uninitialized variable - this is done by filling local stack-based variables with a pattern just like I described above, and when the data is being used as a pointer/index, it is detected as a "uninitialized data" error, rather than a random "got outside valid memory".
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
If you want to put it that way, sure.
There are always several ways to catch uninitialized variables.
Having a debugger do it for you is nice, I think.
Oh and some compiler will warn you if you try to use an uninitialized variable. I'm guessing GCC does and I know VC++ does.
Remember always to put your compiler warnings to maximum!
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.