调试窗口出现一串 屯屯屯屯屯屯屯屯屯屯

sunnyheyun sunnyheyun 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
大家好,写了一个简单的线性表程序,如下。但是单步调试观察变量的时候,却是一串 屯屯屯屯屯屯屯屯屯屯屯屯屯,这是咋回事?如何修改?

程序源码如下:
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
...全文
评论 18
收藏 已收藏
分享
返回顶部
sunnyheyun
C语言 70,039 成员 243,237 内容