这个c++程序除了什么问题?怎样改?

来源:百度知道 编辑:UC知道 时间:2024/06/29 21:36:49
build的结果:Deleting intermediate files and output files for project 'examplech417 - Win32

Debug'.
--------------------Configuration: examplech417 - Win32 Debug--------------------
Compiling...
examplech417.cpp
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/examplech417.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

examplech417.exe - 2 error(s), 0 warning(s)
这是什么回事?搞不明白。。。以下是源代码

#include<iostream.h>
#include<string.h>
#include<conio.h>

class Person
{
static int total;
static int Max_number;
public:
Person();
static void display()
{
cout<<"total="<<total<<endl;
cout<<"Max_number:"<<Max_number<<endl;
}

void print_no()
{
cout<<S_number<<endl;
}

void mian()

写错了!应该是main而不是mian

unresolved external symbol _main
-- -- --
估计没什么问题,就是把main写成了mian,呵呵~

兄弟 和我一样main函数些错了,以前本人也写错了改了半天

#include<iostream.h>
#include<string.h>
#include<conio.h>

class Person
{
static int total;
static int Max_number;
public:
Person();
static void display()
{
cout<<"total="<<total<<endl;
cout<<"Max_number:"<<Max_number<<endl;
}

void print_no()
{
cout<<S_number<<endl;
}
private:
char*name;
int S_number;
};

Person::Person()
{
char name1[20];
cout<<"Please Input Staffer Name:";
cin>>name1;
name= new char[strlen(name1)+1];
name = strcpy(name,name1);
total++;
S_number = 1000+total;
Max_number = S_number; <