02-03-2010, 10:52 AM
I don't think so.
If an object is only accessed from within a single function, the issue is to "pull" the definition into that function. It avoids having both a declaration and a definition with possible differences between the two, initialization issues, scoping issues, etc. And since it isn't used anywhere else, there's no reason not to define the object at block scope.
Just my 5 cents, of course.
FWIW,
Johan
If an object is only accessed from within a single function, the issue is to "pull" the definition into that function. It avoids having both a declaration and a definition with possible differences between the two, initialization issues, scoping issues, etc. And since it isn't used anywhere else, there's no reason not to define the object at block scope.
Just my 5 cents, of course.
FWIW,
Johan
<r>Johan Bezem<br/>
Email: <EMAIL email="[email protected]">[email protected]</EMAIL><br/>
Tel: +49 172 5463210<br/>
Web: <URL url="http://www.bezem.de/">http://www.bezem.de/</URL></r>
Email: <EMAIL email="[email protected]">[email protected]</EMAIL><br/>
Tel: +49 172 5463210<br/>
Web: <URL url="http://www.bezem.de/">http://www.bezem.de/</URL></r>