Hi guys, School is out and I just had my semester of C++ in college and I know I need more help so I got more assignments to do over winter break.
I'm reading "simple" arithmetic problems from a file and I'm supposed to output them on the screen with the answer
Ex;(file)
1 2 3 4 5
5 * 3
7 - 2
955 + 14
54 / 8
&
On screen output:
5 * 3 = 15
7 – 2 = 5
955 + 14 = 969
54 / 8 = 6
I'm having a really hard time doing this... I thought it was easy but I was wrong.
There's spaces and I don't know how to get the information...
My problem:
I've tried
cin.getline method with a delimiter of \n but I'm supposed to stop reading at '&' and I can't hard code inStream.getline(x,5,'\n'); until the last line.
So anyone have any suggestions how I would solve this? Thanks :I