Are you sure you've got that code right? I think your backets may by miss-positioned. For a start a class should usually finish with a ';', unless you're declaring a type thereafter.
As for const.
I think what you have is int a() is the functioning with of class a. Therefore by placing const at the end of the line, you saying that the member function a (also the constructor since they have the same name), won't change any other elements within class a. Which is rather odd for a constructor.
However
::int(int c)would be illegal if this was a member function, I would expect to see something more like this:
int a(int c)::b(c) constBut even that would be illegal, since constructors can't return data like this - there set up to return a pointer to the newly created class!! So now I'm well confused. Where did you find this code? John
Login