求助 一个最简单的程序 vc++ 6.0编译
才开始学呢,大侠们帮帮我啊!//student.h
#ifndef STUDENT_h
#define STUDEN_h
class Student
{
public:
void input(char* n,char *na,float s);
void modify(float s);
void display();
private:
float score;
char* name;
char* id;
};
#endif
//student.cpp
#include<iostream.h>
#include<string.h>
#include "Student.h"
void Student::input(char* n,char* na,float s)
{
score=s;
id=new char[strlen(n)+1];
strcpy(id,n);
name=new char[strlen(na)+1];
strcpy(name,na);
}
void Student::modify (float s)
{
score=s;
}
void Student::display ()
{
cout << "\n id:" << id;
cout << "\n name:" << name;
cout << "\n score:" << score;
}