C语言疑惑
时间:2010-09-03 来源:再快一点
#include "stdio.h"
#include "malloc.h"
struct Student
{
int id;
char *name;
};
void errorFun()
{
struct Student arr[5];
struct Student *parr[5];
for(int i=0;i<5;i++)
{
struct Student stu;
stu.id=i;
stu.name="wq";
arr[i]=stu;
parr[i]=&stu;
}
}
void main()
{
errorFun();
}
#include "malloc.h"
struct Student
{
int id;
char *name;
};
void errorFun()
{
struct Student arr[5];
struct Student *parr[5];
for(int i=0;i<5;i++)
{
struct Student stu;
stu.id=i;
stu.name="wq";
arr[i]=stu;
parr[i]=&stu;
}
}
void main()
{
errorFun();
}
相关阅读 更多 +