Rational(long n,long d):N(n),D(d)

A constructor is declared inside a class. but I didn't understand what N(n) and D(d) are. note that N and D are two private members of class Rational. does any one know?

Rational(long n,long d):N(n),D(d){

}
It's initialisation. The effect is similar to this:
1
2
3
4
Rational(long n,long d) {
    N = n;
    D = d;
} 

Topic archived. No new replies allowed.