Syntax namepsace:class(method):a(method)

Could someone explain this syntax in a simple matter? Thanks in advance!

I am only guessing that's a method in the parenthesis, and the 'a' I have no idea what it is.

 
  namespace:class(m1,m2,m3):x1(m1),x2(m2),x3(m3)
The syntax you posted is not valid. I'm presuming you mean something like this:

1
2
3
4
5
6
7
8
9
10
11
12
namespace foo  // Create namespace foo
{  class bar       // class bar inside namespace foo
    {  int x1, x2, x3;  // private variables
     public: 
         bar (int m1, int m2, int m3);  // constructor
    };
};

// Implementation of bar's constructor
//  Takes 3 arguments and initializes it's private variables from the arguments
foo::bar::bar (int m1, int m2, int m3) : x1(m1), x2(m2), x3(m3)
{}

Note: We have not done a using namespace foo;, so we qualify the constructor by the namespace.

and the 'a' I have no idea what it is.

What 'a'?
Last edited on
I was referring the 'a' to the one in the title. I should have kept the variables same, my bad. Anyways, thanks! I think that answered my question!
Topic archived. No new replies allowed.