首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

error C2275:'FILE'illegal use of this type as an expression解决思路

2012-05-29 
error C2275:FILEillegal use of this type as an expressionerror C2275: FILE : illegal use of thi

error C2275:'FILE'illegal use of this type as an expression
error C2275: 'FILE' : illegal use of this type as an expression


code:FILE *file = _wfopen(szName, TEXT("rb"));
就这么一条代码,报这么个恶心错,大哥们帮忙看看,怎么下手处理呢?


最后的10分,晕....

[解决办法]
貌似_wfopen()的问题,szName参数的类型对吗?
[解决办法]

C/C++ code
FILE file = _wfopen(szName, TEXT("rb")); //这样试试
[解决办法]
应该是工程设置或者也许重新定义了FILE结构什么的

_wfopen(szName, TEXT("rb"));

直接这样写,报错吗
[解决办法]
_tcscat(szName,TEXT("MMDic.dat"));

//////这中间没有其他的代码了吗?

//得到库文件
FILE *file = _wfopen(szName, TEXT("rb"));// <--------------报错的恶心地方 

你检查一下.正代码之前,有没有少写了什么,比如) ; #endif 这些之类的.报这个错的原因就是 FILE * file 这句编译器没有把它当作声明一个file,而是 FILE 乘 file.
[解决办法]
你自定义的头文件中FILE大概被重新定义了。。。。请认真查查有没有类似
#define FILE xxx
的地方

热点排行