#include<stdlib.h>
struct date {
int year
int month
int day
}
struct student {
long int no
char name[20]
struct date birthday
unsigned sex
float score
}
struct student mstd[3] = {//std是C++的命名空间名称,这里改为mstd。要说明的是,假如你使用标准C编译环境就没有命名冲突了,若使用C++环境则会报错。
{2013160123,"ZHANG San",1997,7,21,0,90.00},{2013160124,"LI Si",1998,8,21,1,92.00},
{2013160125,"WANG Wu",1999,2,21,0,93.00}
}
int main() {
int i
long no
printf("please input no:\n")
scanf("%ld",&no)
for (i = 0i < 3i++)
if (no == mstd[i].no) {
printf("no\t\tname\t\tyear\tmonth\tdat\tsex\tscore\t\n")
printf("%ld\t%s\t\t%d\t%d\t%d\t%u\t%.2f\t", mstd[i].no, mstd[i].name, mstd[i].birthday.year, mstd[i].birthday.month, mstd[i].birthday.day, mstd[i].sex, mstd[i].score)
break
}
if (i == 3) printf("error!")
getchar()
getchar()
return 0
}
链接错误应该会提示重定义的符号名,你要查一下是哪个符号。可以肯定不是SYSTEM_MODULE_INFORMATION
PSYSTEM_MODULE_INFORMATION
重定义。应该是在EnumSymbols.h
里面定义了别的变量或者函数。类型重复定义不会在链接时候报错,只会在编译时报错。
struct student *pood=(struct student *)malloc(sizeof(struct student))//插入新的结点改成:
pood=(struct student *)malloc(sizeof(struct student))//插入新的结点
或者删除前面定义的struct student *pood。