如下程序如何在VisualC++中运行
//student. h
#include<string>
using namespace std;
class student
{
public:
void display();
private:
int num;
string name;
char sex;
};
//student. cpp
#include<iostream>
#include"student.h"
void student::display()
{cout<<"num:"<<num<<endl;
cout<<"name:"<<name<<endl;
cout<<"sex:"<<sex<<endl;
}
//main.cpp
#include<iostream>
#include"student.h"
using namespace std;
int main()
{
student stud;
stud display();
return 0;
}