读书人

found #039;int (#039; at global scope (was

发布时间: 2012-03-24 14:00:46 作者: rapoo

found 'int (' at global scope (was a declaration intended?)
#include <iostream>
using namespace std;

#include <windows.h>

void my_interface()
{
system("cls");
system("echo exit|%ComSpec% /k prompt e 100 B4 00 B0 12 CD 10 B0 03 CD 10 CD 20 $_g$_q$_|debug>nul");
system("chcp 437>nul");
system("graftabl 936>nul");

cout << " ";
cout << char(1) <<" welcom " << char(1) << endl;
cout << setw(80) << setfill('*') << '*';
cout << endl << endl << endl << endl << endl << endl << endl << endl;
cout << endl << endl << endl << endl << endl << endl << endl << endl;
cout << endl << endl << endl << endl;
cout << setw(80) << '*';
cout << " ";
cout << "JCheng iienor_mz@126.com" << endl;

HANDLE hOutput;
COORD loc;
loc.X = 0; loc.Y=2;
hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOutput, loc);
}

int min(int x, int y)
{
return ((x < y) ? x : y);
}

void main()
{
my_interface();
cout << "hello world" << endl;
}
问题补充:如何能够避免出现这种问题呢??

[解决办法]
你去掉他 应该也是可以用的。

min是已经被系统定义的。

#define min(a, b) (((a) < (b)) ? (a) : (b))

读书人网 >C++

热点推荐