最简单的,也出错........
#include <iostream.h>class exe
{
private:
int x;
public:
void setx(int a)
{
x=a;
}
void showx()
{
cout<<x<<endl;
}
};
void main()
{
exe sz[2],*p;
sz[0].setx(11);
sz[1].setx(22);
p=sz;
p->showx();
p++;
p->setx{};
}
错误信息
--------------------Configuration: 静态函数访问 - Win32 Debug--------------------
Compiling...
静态函数访问.cpp
G:\Users\Maiiho\Desktop\新建文件夹 (2)\c\静态函数访问.cpp(24) : error C2143: syntax error : missing ';' before '{'
G:\Users\Maiiho\Desktop\新建文件夹 (2)\c\静态函数访问.cpp(24) : warning C4551: function call missing argument list
执行 cl.exe 时出错.
静态函数访问.exe - 1 error(s), 0 warning(s)