gpt4 book ai didi

c++ - 成员引用基类型 'char' 不是 C++ 中的结构或 union

转载 作者:行者123 更新时间:2023-11-28 04:33:52 26 4
gpt4 key购买 nike

<分区>

有人可以帮我用 C++ 调试这个问题吗?如果用户想再次输入,我希望它循环,但错误不断出现。

void typeA(){
int j;
char dec;
do{
cout << "Enter Month: ";
cin >> month[j];
cout << "Enter Date: ";
cin >> date[j];
cout << "Enter Time in Hour: ";
cin >> aHours[j];
cout << "Enter Time in Minutes: ";
cin >> aMins[j];
cout << "Enter Time Out Hour: ";
cin >> aHours[j];
cout << "Enter Time Out Minutes: ";
cin >> aMins[j];

cout << "Enter Again?: [y/n]";
cin >> dec;

}while(!dec.compare('y'));
cout << "Exit";

}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com