Home > Back-end >  Refer to custom classes, when debugging, he said, not a statement!!!!! , I was drunk. Help me, I hav
Refer to custom classes, when debugging, he said, not a statement!!!!! , I was drunk. Help me, I hav

Time:09-28

Application environment: VS2010 languages: c + +
//custom class Point
# ifdef POINT

The class Point
{
Public:
Point (int x, int y) {this - & gt; X=x; This - & gt; Y=y; }
Int get_x () {return x; }
Int get_y () {return y; }
Private:
int x;
int y;
};

# endif

//reference Point of custom
Int setSizePacket (STD: : queue PacketSize);//the value

Error:
Error 1 error C2065: "the Point" : no statement of identifiers


CodePudding user response:

# ifdef POINT
# endif

Look at the two sentences are commented

CodePudding user response:

When use this Point class, to ensure that Point has been define

CodePudding user response:

Because # ifdef POINT the macro definition is not defined, so the code inside it or not
  • Related