求解释
#include<iostream>#include<string>
using namespace std;
const int StackSize=10;
typedef struct
{
int notask; char name[10];}DataType;
class SeqStack
{
public:
SeqStack( ) {top = 0;}
~SeqStack( ) { }
void Push( DataType x )
{
if (top== StackSize-1) throw "溢出";
top++;
data[top] = x;
}
DataType Pop( )
{ if (top==-1) throw "溢出";
DataType x=data[top--];
return x;}
DataType data[StackSize];
int top;
};
int main()
{ SeqStack a;
DataType b[5];
for(int i = 1 ; i <= 5; i++)
{cin>> b[i].name;
b[i].notask = i; }
for( i = 1 ; i <= 5; i++)
{ a.Push(b[i]);}
for( i = 1 ;i <= 5; i++)
{DataType k ;
k = a.Pop();
cout<< k.name <<" "<<k.notask << endl;}}
看不懂typedef struct
{
int notask; char name[10];}DataType;
作用是什么,c++中typedef 作用是什么