Usage | Effect |
---|---|
inside a function | remains even after the function call is long gone |
modify a global variable | private to a certain file |
modify a function | making those functions visible only to the file itself |
Software, web, and programming tips: C++, Java, C, Linux, Windows, Cygwin, Firefox, Vim, WWW, RSS
Showing posts with label keyword. Show all posts
Showing posts with label keyword. Show all posts
Wednesday, May 9, 2007
C - Static Keyword
Friday, February 23, 2007
C++ - const
Keyword
Use the keyword
const
to signify (to developers, not just the compiler) that a variable does not change)./**
* This method doesn't change its object
* @param[in] obj Reference to a constant MyObj
* @return A constant reference to obj
*/
const MyObj& MyObj::myMethod(const MyObj &obj) const
{
return obj;
}
Subscribe to:
Posts (Atom)