I have a file named "t.txt" which contains:
1 2 3 4 5 6 7
8 9 0
Now I want to create two arrays that contain the entries of that individual line like: arr1[7]={1,2,3,4,5,6,7}; arr2[3]={8,9};
Now if there are n number of lines in "t.txt" then I want to create n arrays that contain contents of that individual line.
I don't want to use strings and multi-dimensional arrays.
`
#include <iostream>
#include <fstream>
using namespace std;
int main(){
ifstream input_file;
input_file.open("t.txt");
char arr1[50]={0};
char idata;
int c =0,line_c=1;
while (!input_file.eof())
{
input_file.get(idata);
c++;
if (idata == '\n')
{
c = 0;
line_c++;
}
//cout<<"lc"<<line_c<<"sc"<<c<<"ec"<<idata;
}
return 0 ;
}
`