|
From: James W. W. <ja...@wr...> - 2005-01-04 19:36:12
|
Roger Holmes <rog...@mi...> wrote: >When I am writing new routines or modifying new ones I am very tempted >to adopt the normal C++ style of not declaring variables until they >are needed, >which usually is by setting the variable to an initial value, thereby avoiding >many cases of uninitialised variables. > >Are there any reasons for not doing so now? One small problem with that approach is that one can easily end up with a variable name being declared in multiple scopes within the function. Then if I'm using the CodeWarrior debugger, it's hard to tell which version of the variable I should be looking at. (Maybe other debuggers handle this situation better?) -- James W. Walker, ScriptPerfection Enterprises, Inc. <http://www.write-brain.com/> |