C++中编译通过,运行错误问题
我是一名编程的初学者,在学习中遇到了一些问题,希望大家帮我解决!#include <iostream.h>
void main()
{
enum color {red,yellow,white=8,blue,black=-3,green=97};
color i=yellow;
int mycolor=red;
char ch=green;
cout << i << endl << mycolor << endl << ch << endl;
cout << (yellow<black?yellow:black) << endl;
cout << (white+black) << endl << ch << endl;
}
这段代码是正确的,编译成功,运行出错!
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Test1_0.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.