我有这个问题...C++静态与结构parametrs
我有我的结构方法:
Mystruct s;
s.a = 1;
s.b = 2;
Mystruct t;
t.a = 1;
t.b = 2;
MyClass.MyStaticMethod(s,t);
我有这个错误在C ompile时间:
Error 51 error C2228: left of '.MyStaticMethod' must have class/struct/union
Error 50 error C2275: 'MyClass' : illegal use of this type as an expression
在'Mystruct'的定义中使用'typedef'是无用的。我建议你删除它,但是如果你真的需要它在C++中所做的* small *区别,则需要为typedef'typedef struct MyStruct {..} MyStruct;'提供一个名称。再次,我会放弃它。更多[here](http:// stackoverflow。com/a/1675446/36565),注意即使主要焦点是C,答案也涉及C++ – 2012-04-04 11:53:07