首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

found 'int (' at global scope (was a declaration intended?)解决思路

2012-03-24 
found int ( at global scope (was a declaration intended?)#include iostreamusing namespace std#

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))

热点排行