F
Fred H
I'm reading a STL book right now, and there I've
picked up the folowing syntax:
class C {
private:
int value;
public:
C(int initValue) : value(initValue) { }
}
I can see what it does, but...why? Why is it written
this way, and not like:
class C {
private:
int value;
public:
C(int initValue) {
value = initValue;
}
}
The first snippet looks like some inherit-stuff, but
obviously it's initializing the private member. So why
is this syntax used, and is it at all different from
the second snippet quality-wise?
--
Fred H
void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}
picked up the folowing syntax:
class C {
private:
int value;
public:
C(int initValue) : value(initValue) { }
}
I can see what it does, but...why? Why is it written
this way, and not like:
class C {
private:
int value;
public:
C(int initValue) {
value = initValue;
}
}
The first snippet looks like some inherit-stuff, but
obviously it's initializing the private member. So why
is this syntax used, and is it at all different from
the second snippet quality-wise?
--
Fred H
void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}