Jump to content

C++ class constructor syntax


Markup

Recommended Posts

class student
{
public:
int roll;
int marks;

protected:
char name[50];
};

 

':' indicates that from that point on all variables beyond that point are in public scope of the class (for "public:")

Opeious.pngopei.png

 

Barrows Drops:....................................................Dragon Drops:...............Other Drops:

Dharok: 2 Helms, 1 Top, 2 Legs, 4 Axes.......................2 Claws Split..................1 Bandos Tassets

Karil: 1 Coif, 1 Top, 2 Skirt, 2 Crossbows......................3 Plate legs...................4 Berserker Rings

Ahrim: 3 Hood, 2 Top, 3 Skirt, 1 Staff..........................2 Plate Skirts.................2 Warrior Rings

Verac: 1 Helm, 3 Tops, 2 Skirts, 1 Flail..........................1 Med........................1 Archer Ring

Guthan: 2 Helm, 5 Tops, 1 Skirt, 0 Spear.....................1 Shield Half.................1 Seers Ring

Torag: 2 Helms, 2 Tops, 5 Legs, 1 Hammer....................4 Hatchets..................1 Missed Divine Sigil (was at bank -,- fml)

Link to comment
Share on other sites

class student
{
public:
int roll;
int marks;

protected:
char name[50];
};

 

':' indicates that from that point on all variables beyond that point are in public scope of the class (for "public:")

 

Sorry, forgot about the other ":"

 

I mean the one in here:

client(blah& thing, . . .) : uno_(thing), dos_(thing) 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.