#include<iostream>
using namespace std;
class P
{
public:
char name[10];
void g_n(){cout<<"name:"<<endl;cin>>name;}
void o_n(){cout<<name<<endl;}
virtual void g_d()=0;
virtual bool o_s()=0;
};
class S:public P
{
private:
float mark;
public:
void g_d(){P::g_n();cout<<"mark"<<endl;cin>>mark;}
bool o_s(){return mark>4? true: false;}
};
class T:public P
{
private:
int n;
public:
void g_d(){P::g_n();cout<<"n"<<endl;cin>>n;}
bool o_s(){return (n>100?true:false);}
};
void mian()
{
P *w[10];
int n=0;
char choice;
cout<<"choice"<<endl;
cin>>choice;
while(choice!='y')
{
cout<<"S or T"<<endl;
cin>>choice;
if(choice=='s')
w[n]=new S;
else
w[n]=new T;
cout<<"enter another"<<endl;
cin>>choice;
}
for(int i=0;i<n;i++)
{
w[i]->o_n();
if(w[i]->o_s())
cout<<"this is outstanding"<<endl;
}
}
用Microsoft Visual C++ 6.0编译以后,不能运行出现以下错误
--------------------Configuration: gg - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/gg.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
gg.exe - 1 error(s), 0 warning(s)
那位朋友能指点一下不胜感激!!!!!!!!!!!!!!