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

typedef static int int32;解决方案

2012-05-15 
typedef static int int32[codeC/C++][/code]#includeiostreamusing namespace stdtypedef static in

typedef static int int32;
[code=C/C++][/code]


#include<iostream>
using namespace std;

typedef static int int32;
int main()
{
  return 0;

}
error C2159: more than one storage class specified

这个出错是不是编译器怕以后定义int32此类型时到处都是静态类型变量?
还是别的原因?谢了大家

[解决办法]
typedef 被当做存储类型指示符,其他的指示符还有extern、auto、register、static,一个定义里只能有一个存储类型指示符,所以typedef和static 不能共存。
可以使用#define int32 (static int)来实现。 

热点排行