What is the difference between these functions below (Look at the const keyword)?
const
void f1(const Class &c)
and
void f2(Class const &c)
There is no difference. Two versions are interchangeable.
There is no difference between const Class& and Class const& ; Similarly, there is no difference between const Class* and Class const* . Both indicate a reference / pointer to a constant instance of Class .
const Class&
Class const&
const Class*
Class const*
Class
However, Class* const is a completely different beast. This is a constant pointer to a non-const Class instance.
Class* const
(pedantic answer):
The difference is the name.
The name f1 will be different from f2 - even after mangling
f1
f2
The signatures are exactly the same, so otherwise there would be no difference
They are not at all different. See paragraphs 18.6 and 18.8 in on this page for details .