C++ 正在搜索链接到cout的变量的名称!像a:coutc++;
当我在互联网上通过源代码搜索新信息时, 我看到有人将C++ 正在搜索链接到cout的变量的名称!像a:coutc++;,c++,windows,cout,goto,C++,Windows,Cout,Goto,当我在互联网上通过源代码搜索新信息时, 我看到有人将goto用于变量,该变量与cout 语句,与std::cout中的语句相同 他写了a:cout 你能帮我找到这个函数的名字吗 void Main_Menu() { int i; cout << "\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t HOSPITAL MANAGEMENT SYSTEM \n\n"; cout << "\n
goto
用于变量,该变量与cout
语句,与std::cout
中的语句相同
他写了a:cout
你能帮我找到这个函数的名字吗
void Main_Menu() {
int i;
cout << "\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t HOSPITAL MANAGEMENT SYSTEM \n\n";
cout << "\n\n\t\t\t\t\t\tPlease, Choose from the following Options: \n\n";
cout << "\t\t\t\t\t\t _________________________________________________________________ \n";
cout << "\t\t\t\t\t\t| |\n";
cout << "\t\t\t\t\t\t| 1 >> Add New Patient Record |\n";
cout << "\t\t\t\t\t\t| 2 >> Add Diagnosis Information |\n";
cout << "\t\t\t\t\t\t| 3 >> Full History of the Patient |\n";
cout << "\t\t\t\t\t\t| 4 >> Information About the Hospital |\n";
cout << "\t\t\t\t\t\t| 5 >> Exit the Program |\n";
cout << "\t\t\t\t\t\t|_________________________________________________________________|\n\n";
a: cout << "\t\t\t\t\t\tEnter your choice: ";
cin >> i;
if (i > 5 || i < 1) {
cout << "\n\n\t\t\t\t\t\tInvalid Choice\n";
cout << "\t\t\t\t\t\tTry again...........\n\n";
goto a;
} //if inputed choice is other than given choice
void主菜单(){
int i;
cout 5 | | i<1{
cout没有变量a
链接到cout
。a:
是一个标签,您可以通过goto a;
跳转到该标签。代码也可以像
a:
cout << "\t\t\t\t\t\tEnter your choice: ";
cin >> i;
if (i > 5 || i < 1) {
cout << "\n\n\t\t\t\t\t\tInvalid Choice\n";
cout << "\t\t\t\t\t\tTry again...........\n\n";
goto a;
} //if inputed choice is other than given choice
有效的C?因为http
和https
被视为标签,并且/
开始注释。您是否询问goto
和标签,因为这是代码所做的。顺便说一句,使用空格而不是制表符。制表符可以表示8、3、4或2个空格。制表符可以表示将空格移到下一个制表位(可能是间歇性的)。标签也可以忽略。非常感谢兄弟
void f()
{
http://stackoverflow.com
https://stackoverflow.com
}