I want to read a file into three arrays , the file looks like this :
Bar soap
1000 0.27
Laundry Detergent
200 5.15
as you can see the first line must read into array of type string. The second array of type integer should read the first number in the second line, The last array should be type float and read the last part. How can I do that in c++. Thanks for sharing the knowledge.
Thank you. Can you just explain to me how this code jump from one line to another , and from the first piece in the second line to the second piece in the same line?
O,k thanks for being there. Suppose I have this
soap // the first line in the file (goes to string )
200 2.0 // the second line in the file goes to integer array and float.