-
Anonymous
Массив C++ 2d из fstream не сохраняется правильно
Сообщение
Anonymous »
Код: Выделить всё
#include ;
#include
#include ;
using namespace std;
int main() {
// Create Text File to store the Values
const int ARRAY_SIZE = 10;
int numbers[ARRAY_SIZE] = { 5, 10, 8, 7, 3, 4, 9, 6, 2, 1 };
int store_count;
ofstream outputFile;
outputFile.open("TenNumbers.txt");
for (store_count = 0; store_count < ARRAY_SIZE; store_count++) {
outputFile num_row1[count])
cout num_row2[count])
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/69653959/c-2d-array-from-fstream-not-being-stored-correctly[/url]
1736276611
Anonymous
[code]#include ;
#include
#include ;
using namespace std;
int main() {
// Create Text File to store the Values
const int ARRAY_SIZE = 10;
int numbers[ARRAY_SIZE] = { 5, 10, 8, 7, 3, 4, 9, 6, 2, 1 };
int store_count;
ofstream outputFile;
outputFile.open("TenNumbers.txt");
for (store_count = 0; store_count < ARRAY_SIZE; store_count++) {
outputFile num_row1[count])
cout num_row2[count])
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/69653959/c-2d-array-from-fstream-not-being-stored-correctly[/url]