高手们帮忙解决下!我新人问题!
#define NULL 0
#define TYPE struct stu
#define LEN sizeof (struct stu)
#include <malloc.h>
struct stu
{
int num;
int age;
struct stu *next;
};
TYPE *creat(int n)
{
struct stu *head,*pf,*pb;
int i;
for(i=0;i<n;i++)
{
pb=(TYPE*)malloc(LEN);
printf("input Number and Age\n");
scanf("%d%d",&pb->num,&pb->age);
if(i==0)
pf=head=pb;
else pf->next=pb;
pb->next=NULL;
pf=pb;
}
return(head);
}
在vc6.0 中编译2个报错
Compiling...
2.cpp
C:\C语言程序\2.cpp(18) : error C2065: 'printf' : undeclared identifier
C:\C语言程序\2.cpp(19) : error C2065: 'scanf' : undeclared identifier
Error executing cl.exe.
2.obj - 2 error(s), 0 warning(s)
在win-tc中编译报告没有主函数mian,请教高手们我如何在win-tc中编译通过,在vc6.0中也编译通过呢??