typedef(给定义数据的类型重命名)
- 给基本数据类型另起一个名字:
typedef 基本数据类型如int 自定义名字如QElemType
typedef int QElemType; - 给自定义结构体另起一个名字:
typedef struct {
QElemType data[MAXSIZE];
int front;
int rear;
}sqQueue;
Status(一种函数返回类型)
当函数返回值为函数结果状态代码时,函数定义为Status类型。函数结果状态码:TRUE 1、FALSE 0;OK 1、ERROR 0;INFEASIBLE -1、OVERFLOW -2
Status InitQueue (SqQueue *Q) {
Q->front = 0;
Q->rear = 0;
return OK;
}