> >> Do people do that in practice? Is it good practice? > > > > Most people don't bother using const for function parameters that are > > primitives (ints, bools, char, etc). I still do, since I think it's > > good documentation: it indicates you never intend to modify it in the > > function, and frees up your mental stack to track something else. > > hmmm, think I'll follow the crowd ;) >
The other reason for using const is to give the compiler a hint about the use of this variable. It can be used by the compiler to improve optimisation. -- Ken Foskey FOSS developer _______________________________________________ coders mailing list [email protected] http://lists.slug.org.au/listinfo/coders
