Hello,
I'm trying to make a very simple class, but it doesn't work, and I don't know why!
GraphPoint.h:
1 2 3 4 5 6 7 8 9
|
#ifndef _GRAPHPOINT_H
#define _GRAPHPOINT_H
class GraphPoint
{
public:
double x,y;
bool operator< (const & GraphPoint in_lh) const;
};
#endif
| |
graphpoint.cpp:
1 2 3 4 5
|
#include "GraphPoint.h"
bool GraphPoint::operator< (const & GraphPoint in_lh) const
{
return (x < in_lh.x);
}
| |
Now, Upon compillation I get these error:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
(this refers to the bool return type)...
error C2146: syntax error : missing ',' before identifier 'in_lh'
error C2065: 'in_lh' : undeclared identifier
error C2228: left of '.x' must have class/struct/union
for sanity I've tried compiling this:
1 2 3 4
|
bool func()
{
return true;
}
| |
and it compiled just fine...
Whats going on?!