AC> class Vector {
AC> public:
AC> double x, y, z;
AC> Vector();
AC> Vector(double x1, double y1, double z1);
void Init(long, long, long);
AC> Vector (Vector &);
AC> Vector operator=(Vector &);
AC> }
AC> Vector Vector::operator=(Vector &b)
AC> {
AC> x = b.x;
AC> y = b.y;
AC> z = b.z;
AC> return *this;
AC> }
void Vector::Init(long lX, long lY, long lZ)
{ x = lX; y = lY; z = lZ; }
AC> int main(void)
AC> {
AC> Vector points[NUM_VECT];
AC> Matrix m;
points[0].Init( 90, -50, 0);
points[1].Init( 0, -90, 0);
points[2] = points[0];
AC> points[0] = Vector( 90, -50, 0); /* warning here */
AC> points[1] = Vector( 0, -90, 0); /* & here */
AC> }
Your RValue isn't actually a type Vector variable in the
assignment statements in your example. You want the code to
create a Vector, then return that vector via overloading of
the constructor, but you aren't constructing any data object.
You are just calling the constructor without any data object
to which it should attach. The examples I inserted show an
Init() function and proper use of the assignment operation.
> ] Tagline not responding Accept, Reject, Flame........
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|