#include
#include
using namespace std;
template
class student
{
private:
T name[10];
M age;
static M length;
public:
student();
void input();
void dele();
void out_top();
void output();
};
template
student
{
memset(&name,0,sizeof name);
age = 0;
}
template
M student
template
void student
{
M i;
cout<<"Please input the length:"<
cout<<"Please input the information:"<
{
cin >> this[i].name >> this[i].age;
}
}
template
void student
{
M i;
for (i = 1; i < length; i ++)
{
strcpy(this[i-1].name,this[i].name);
this[i-1].age = this[i].age;
}
length --;
}
template
void student
{
cout<<"The top student's information:"<
template
void student
{
M i;
for (i = 0; i < length; i ++)
{
cout<<"name:"<
}
int main()
{
student
head = new student
head->input();
head->out_top();
head->dele();
head->output();
}
我改了下,在我这里是能正常运行的。你试试吧。
你关键是看错了吧,把函数名看成是参数了。估计是从C转来C++的? :-)
你的题目问题在哪里?