Witam, mam problem z programem wczytującym dane z dwóch plików do jednej tablicy(char).Chodzi o to, żeby program wczytywał liczby z dwóch programów do jednej tablicy. Napisałem taki oto kod, niestety nie działa on poprawnie:
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int length;
int length_2;
fstream plik( "dane9.txt", ios::in );
fstream plik_2( "dane10.txt", ios::in );
char bufor[ 1024 ];
char bufor_2[ 1024 ];
int main(){
plik.read( bufor, 1024 );
plik_2.read(bufor_2, 1024);
length = strlen(bufor);
length_2 = strlen(bufor_2);
for (int i = 0 ;i<length_2;i++)
{
length = length + 1;
bufor[length] = bufor_2[i];
}
cout<<bufor<<endl;
system("pause");
return 0;
}