Tuesday, June 05, 2007

Different Style of Const in a fn

const char* GetOutputData()
{
// within this fn, we can change any values of a variable inside this fn
// and returns constant pointer, we can't modify the pointer returned by this fn
}


char* GetOutputData() const
{
//this fn will not change any values of a variable inside this fn
// and returns char* pointer, we can modify the pointer returned by this fn
}

const char* GetOutputData() const
{
//this fn will not change any values of a variable inside this fn
// and returns constant pointer, we can't modify the pointer returned by this fn

}

Labels:

0 Comments:

Post a Comment

<< Home