Consider:
int testfunc1 (const int a)
{
return a;
}
int testfunc2 (int const a)
{
return a;
}
Are these two functions the same in every aspect or is there a difference?
I'm interested in an answer for the C language, but if there is something interesting in the C++ language, I'd like to know as well.
Best Answer
The trick is to read the declaration backwards (right-to-left):
Both are the same thing. Therefore:
The reading backwards trick especially comes in handy when you're dealing with more complex declarations such as: