程序编译出问题了,请指点
编译时出问题,#include<iostream.h>
struct student
{
long num;float score;
struct student *next;
;
int k=0;
struct student *creat()
{
struct student *head,*p1,*p2;
head=NULL;
p1=new(student);
p2=p1;
cin>>p1->num>>p1->score;
while(k<=5)
{
n++;
if(k==1)
head=p1;
else
p2->next=p1;
p2=p1;
p1=new(student);
cin>>p1->num>>p1->score;
}
delete(p1);
p2->next=NULL;
reture(head);
}
Compiling...
044.cpp
e:\visualc++\install\msdev98\myprojects\04\044.cpp(7) : error C2252: 'k' : pure specifier can only be specified for functions
e:\visualc++\install\msdev98\myprojects\04\044.cpp(30) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
044.obj - 1 error(s), 0 warning(s)