Showing posts with label keyword. Show all posts
Showing posts with label keyword. Show all posts

Wednesday, May 9, 2007

C - Static Keyword

UsageEffect
inside a functionremains even after the function call is long gone
modify a global variableprivate to a certain file
modify a functionmaking those functions visible only to the file itself

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;
}