Hello guys,
My programming professor is insisting that we use the keyword const when declaring our function of a class for example:
1 2 3
//in class header file
bool space_in_front(int) const;
bool space_in_front(constint);
I realize that when it follows the parameter list it prevents the object from being modified and when it's in the parameter list it prevents any of the variables from being modified. My question is, is it wrong to write them as
bool space_in_front(const int) const; where const appears in both, or is this somehow redundant.
Thanks for any feedback you may have.