do循环的问题
程序代码:
int main() { char jx[1]; do { Console::WriteLine("Hello World"); cout<<"按“y”键继续,按其他键退出。"; cin>>jx; } while(jx=="y"); cout<<jx<<"\n"; system("pause"); return 0; }
我想程序循环运行,按y循环运行。但是现在按y也是退出了,没有循环运行。
如果定义为jx定义为int,就可以循环了。
是什么问题呢?
[此贴子已经被作者于2021-3-26 10:02编辑过]