const SimpleCat * const FunctionTwo (const SimpleCat * const theCat);
Ok so this is a function declaration. I'll pose my questions numbered so it is easier. I'm taking an online course in C++ but got stumped on this line of code.
1. The return type is of type SimpleCat and is a pointer. Why do I need to 'return' a pointer? The author of the code writes in FunctionTwo "return theCat;" Why did he do that?
2. I'll make a few statements, please correct me if I am wrong.
The first const says the returned pointer is constant??
The second const says FunctionTwo is a constant function and cannot change any values? I thought the syntax was for the const keyword to be after the function declaration before the terminator.
The third const says the pointer is const to the address given to the function and cannot be reassigned.
The fourth const says the object theCat(which is pointing to whatever) is const therefore only const member methods can be called. Can const member variables be called?
Thanks in advance.