c++ missing storage-class or type specifiers
#include<iostream>#include<deque>usingnamespacestd;intamount;structtabulist{number;po...
#include<iostream>
#include<deque>
using namespace std;
int amount;
struct tabulist
{
number;
position1;
position2;
};
void main()
{
cout<<"please input the number of jobs:\n";
cin>>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
如何修改? 展开
#include<deque>
using namespace std;
int amount;
struct tabulist
{
number;
position1;
position2;
};
void main()
{
cout<<"please input the number of jobs:\n";
cin>>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
如何修改? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询