c++ missing storage-class or type specifiers

[复制链接]
查看11 | 回复1 | 2009-8-3 11:58:55 | 显示全部楼层 |阅读模式
#include
#include
using namespace std;
int amount;
struct tabulist
{
number;
position1;
position2;
};
void main()
{
cout>amount;
tabulist * tl;
if(amount<=50)
{
tl = new tabulist[5];

}
else
{
tl = new tabulist[7];
}
}
为什么会出现error C2501: 'number' : missing storage-class or type specifiers
error C2501: 'position1' : missing storage-class or type specifiers
error C2501: 'position2' : missing storage-class or type specifiers
如何修改?

回复

使用道具 举报

千问 | 2009-8-3 11:58:55 | 显示全部楼层
tabulist中的成员类型没声明...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行