gpt4 book ai didi

C++读取数组cin错误

转载 作者:行者123 更新时间:2023-11-27 23:24:45 26 4
gpt4 key购买 nike

我已经一年多没有用 c++ 编写代码了,我看不到这段代码中的错误。

它说 cin 函数有错误,没有这样的运算符 >>

int main()
{
double * array[25];
bool exitCode = false;
cout <<"Enter in your Array"<<endl;
do{
for(int i = 0; i < 24; i++)
{
cout<< "Enter your float number";
cin >> array[i];

cout << "Are there any more inputs?: ( Y or N )";
cin >> exitCode; // error is here
}
}while(exitCode == false);

return array;
}

最佳答案

确保您包括以下内容:

<fstream>
<istream>
<iostream>
<string>

关于C++读取数组cin错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10201952/

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