以下这段程序在连接时给出
Linking...
libcd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/exercise4.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
望告知如何解决。
#include<iostream.h>
#include"string.h"
class city
{
private:
char *name,*country;
int population,area;
public:
city(char *vname,char *vcountry,long vpopulation,
long varea);
~city()
{
delete []name;
delete []country;
};
void display()const;
};city::city(char *vname,char *vcountry,long vpopulation,long varea)
{
name=new char[strlen(vname)];
if(!name)
cout<<"the error of the memory"<<endl;
else
        strcpy(name,vname);
country=new char[strlen(vcountry)];
if(!country)
cout<<"the error of the memory"<<endl;
else
    strcpy(country,vcountry);
population=vpopulation;
area=varea;
}void city::display()const
{
cout<<"the name of the city:"<<name;
cout<<'\n'<<"country:"<<country;
cout<<'\n'<<"the population of the city:"<<population;
cout<<'\n'<<"the area of the city:"<<area<<endl;
}void mani()
{
city *p;
p=new city("nanjing","china",3000000,400000);
if(!p)
cout<<"the error of the memory"<<endl;
else 
{
(*p).display();
delete p;
}
}