cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Rational(long n,long d):N(n),D(d)
Rational(long n,long d):N(n),D(d)
Nov 3, 2012 at 8:46pm UTC
msdagiya
(26)
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){
}
Nov 3, 2012 at 8:54pm UTC
Chervil
(7320)
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.