0
我想用文本文件中的数据填充数组。我试过数据文件处理,但它不能在代码块中工作。这是我写的代码,它向我展示了0或者与文件中存在的完全不同的数字。如何从代码锁中的数组中的文本文件获取输入?
`//all variables not declared over here have been declared globally.This is just a part of //my code
int main()
{
fstream f;
f.open("IntegerArray.txt",ios::in);
for(z=0;z<100000;z++)
{
cout<<f;
f>>arr[z];
cout<<arr[z];
getch();
}
f.close();`
}