最近自己在写一个小测试程序时,一不留神gcc编译的时候,就报了错误“error:invalid use of undefined type 'struct xxxx'”
下面是测试程序片段:
#define MAX_NUM 256
#define OPD_MAX_LEN 10
typedef struct _optStack
{
char opt[MAX_NUM];
int top;
} optStack;
typedef struct _opdStack
{
int opd[MAX_NUM];
int top;
} opdStack;
struct optStack optSt;
struct opdStack opdSt;
void initOptSt()
{
optSt.top = -1;
}