Subscribe For Free Updates!

We'll not spam mate! We promise.

Apr 14, 2013

How do I initialize members of a class?



How do I initialize members of a class?

There are two ways.
struct A
{
int a;
int b;
A(): a(0) { b = 0; } // attribute a and b are initialized to 0
};

TechniqZone Socializer Widget
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment