[TriLUG] OT: C++ Question

Randy Barlow rpbarlow at ncsu.edu
Mon Jan 30 18:36:27 EST 2006


Sorry for the OT post, but this problem is driving me nuts!  (If anyone 
knows of a *good* mailing list that this question would be more 
appropriate for, please let me know!)

The problem: I'm getting a compiler error for the following class 
definition:

#pragma once
#include "vector3d.h"

class point3d {
    public:
        double x, y, z;
        point3d(double, double, double);
        point3d(void);
        ~point3d(void);
        vector3d operator+ (vector3d);
        point3d operator+ (vector3d);
        vector3d operator- (point3d);
        double* operator [] (const int &);
};

The compiler doesn't like the operator overloading statements, 
complaining about syntax, and that it doesn't know what the vector3d 
identifier is.  However, I've included the vector3d.h file where this 
type (another similar class) is defined.  Am I doing something 
incorrectly here?  Thanks!

-- 
Randy Barlow
Research Assistant
Department of Electrical and Computer Engineering
North Carolina State University, Raleigh, NC
rpbarlow at ncsu.edu
http://www.electronsweatshop.com




More information about the TriLUG mailing list