Hey folks. I am confused as to how i can make a constructor take zero - or lets say 3 arguments. If i do this in my main.cpp:
const Vector v1;
const Vector v2(1.0, 2.0, 3.0);
And this in my vector.cpp file:
Vector::Vector(double new_x, double new_y, double new_z)
{
x = 0;
y = 0;
z = 0;
}
And then this in my vector.h file:
...
...
public:
//Vector();
Vector(double, double, double);
};
I get an error saying this:
23 C:\Users\Tony\Documents\csci 241\Assign4\assign4.cpp no matching function for call to `Vector::Vector()'
THis makes sense as there is no constructor like this within my .h or .cpp file - so it doesnt know what to do. But i MUST have only one constructor, is this possible?
Hope you guys can help out again
Thanks in advance