开发者

Visual Studio 2008 struct naming syntax error involving "2dpt"

开发者 https://www.devze.com 2023-02-07 06:30 出处:网络
I was just working with a program that I had used a struct: struct 2dpt { int x; int y; }; And visual studio had given me an error about t开发者_如何转开发he syntax of using \"2dpt\" as the name of

I was just working with a program that I had used a struct:

struct 2dpt {
int x;
int y;
};

And visual studio had given me an error about t开发者_如何转开发he syntax of using "2dpt" as the name of the struct. I searched through all the headers, and tried googling for it as a standard visual studio include, and couldn't find it. I'm not sure why it was spitting this out at me. Does anyone know where this error is coming from?


You can't start the name of a structure or variable with a number.


Well you haven't said what language you're using, which doesn't help... but I don't think I've ever used any language which lets you use a digit at the start of an identifier such as a struct name.

You say:

I was just working with a program that I had used a struct:

which suggests that the struct is in your own code. Find it and rename it to something more sensible.

0

精彩评论

暂无评论...
验证码 换一张
取 消