Possible Duplicates:
Why should I prefer to use member initialization list?
C++ - what does the colon after a constructor mean?
here is following code
class vector2d {
public:
double x,y;
vector2d (double px,double py): x(px), y(py) {}
i dont understand this line
vector2d (double px,double py): x(px), y(py) {}
is it same as
vector2d(double px,double py){ x=px;y=py;}?
or?