今天在编程时遇到这个错误
错误提示:error c2071::illegal storage class
然后在msdn上查了下:
Compiler Error C2071
Error Message
'identifier' : illegal storage classidentifier was declared with an invalid storage class.
Example
The following sample generates C2071.
// C2071.cpp // compile with: /c struct C { extern int i; // C2071 }; struct D { int i; // OK }; |
The following sample generates C2071.
// C2071_b.cpp // compile with: /c typedef int x(int i) { return i; } // C2071 typedef int x; // OK 发现原来是错用了那些关键字。后来检查了一下,发现是explicit使用错误。我将operator=()重载使用了explicit关键字。所以去掉后程序编译通过。 |