error C2275! illegal use of this type as an expression

来源:互联网 发布:python snownlp 编辑:程序博客网 时间:2024/04/27 15:31

 [原创作品---转载请注明出处----

地址:http://blog.csdn.net/jiuaiwo1314]


error C2275! illegal use of this type as an expression 


今天在VS2008上面调试模拟器.编译的时候发现报了这个错误,

经过查看代码发现,VS2008编译器,编译不允许在用到函数的时候

再去声明这个函数,即应把声明函数放在函数体最前面.


例如:

#include <stdio.h>

void func();

int main(void)

{ //在这里如果把声明放在main函数之后,你在VS2008上面编译的时候就会报错.

func(); // 所以,为了能实现在不同编译器上能正确编译,我们应该把声明文件放在函数体前面.

return 0;

}

void func()

{

}


原创粉丝点击