Re: [Dev-C++] Use of const qualifier
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Abhijit S. <mu...@gm...> - 2002-10-31 22:32:22
|
> where myfunc uses the values of x and the array members of y but doesn't > change them. Is there then an efficiency (speed) to be gained by instead > declaring: > > double myfunc(const double x, const double *y)? More than speed, the const qualifier is for debugging. It prevents the programmer from inadvertently changing the values of certain variables. Some new optimizing compilers also use it to align memory more efficiently. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |