调试窗口出现一串 屯屯屯屯屯屯屯屯屯屯
大家好,写了一个简单的线性表程序,如下。但是单步调试观察变量的时候,却是一串 屯屯屯屯屯屯屯屯屯屯屯屯屯,这是咋回事?如何修改?
程序源码如下:
main.c代码
#include <stdio.h>
#include "stu.h"
#include "list.h"
ElemType stu[3]=
{
{"s101", "张三", "男", 80},
{"s102", "小虹", "女", 75},
{"s103", "王五", "男", 90}
};
int main()
{
int i;
LIST *list = NULL;
list = InitLIST();
for (i = 0; i < 3; i++)
{
InsertList(list, 1, &stu[i]);
}
FreeList(list);
}
stu.h定义代码
#ifndef _STU_H
#define _STU_H
typedef struct
{
char sno[6];
char name[30];
char sex[4];
int score;
}ElemType;
#endif
list.h定义代码
#ifndef _LIST_H
#define _LIST_H
#define LIST_INIT_SIZE 10
#define LIST_INCREME 10
typedef struct
{
ElemType *elem;
int length;
int size;
}LIST;
LIST *InitLIST();
void FreeList(LIST *l);
int InsertList(LIST *l, int i, ElemType *e);
#endif