Split String Array using empty line

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:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  // 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;

}
Topic archived. No new replies allowed.