R
ravi
Hi,
I am new to C++ .Can anyone please tell me what does ":" operator
mean in C++.For ex: there is a program snippet which looks like that
class convert {
protected:
double val1; // initial value
double val2; // converted value
public:
convert(double i) {
val1 = i;
}
virtual void compute() = 0;
};
// Liters to gallons.
class l_to_g : public convert {
public:
l_to_g(double i) : convert(i) { }
void compute() {
val2 = val1 / 3.7854;
}
};
In the above piece of code there is a line as
l_to_g(double i) : convert(i) { }
Can anybody tell me wht does the above line mean
Thanks
Ravi
I am new to C++ .Can anyone please tell me what does ":" operator
mean in C++.For ex: there is a program snippet which looks like that
class convert {
protected:
double val1; // initial value
double val2; // converted value
public:
convert(double i) {
val1 = i;
}
virtual void compute() = 0;
};
// Liters to gallons.
class l_to_g : public convert {
public:
l_to_g(double i) : convert(i) { }
void compute() {
val2 = val1 / 3.7854;
}
};
In the above piece of code there is a line as
l_to_g(double i) : convert(i) { }
Can anybody tell me wht does the above line mean
Thanks
Ravi