I am new to C++ I do not understand this type of declaration. For example this is my class:
class Complex
{
public:
Complex( double r, double i ) : re(r), im(i) {}
Complex operator+( Complex &other );
void Display( ) { cout << re << ", " << im << endl; }
double re, im;
};
I don't understand the declaration in this constructor:
Complex( double r, double i ) : re(r), im(i) {}
i.e what is the symbol ":" used for and what happen if we declare like this in constructor re(r), im(i)
.