Write your question here.
Hello I need guidence how to split a string Array into two arrays using an empty line from the source text file:
I have successfully create the array from the text file but I have dont understand how to split the array using the empty file located on the text file:
// Create main Array
while (count<ARRAY_SIZE&& getline(inputFile, array_main[count]))
count++;
// Close File
inputFile.close();
// Check if string lenght is greater that 0
for (count =0, flag=0; count<ARRAY_SIZE; count++, flag++)
if (array_main[count].size()>0)
// If it is greater that 0 initiate second array
{
for (count =0, bags =0; bags<ARRAY_SIZE ; count++, bags++)
array_passangers[bags]=array_main [count];
for (count =0; count<ARRAY_SIZE; count++)
cout<<array_bags[count]<<endl;
}
// If it is less that 0 initiate third array
else
{
for (count =0, passangers =0; passangers<ARRAY_SIZE ; count++, passangers++)
array_passangers[passangers]=array_main [count];
for (count =0; count<ARRAY_SIZE; count++)
cout<<array_passangers[count]<<endl;
}
return 0;
}