Assuming that inStream is opened as a connection to an input file that contains the following data:
b 54 b 32E1 enter -6.78 b $80 enter enter b 1 enter eof
and the following declarations are
int n1, n2, n3, n4;
r1, r2, r3;
c1, c2, c3, c4
List the values that are assigned to each of the variables in the input list or explain why an error occurs.
inStream >> n1 >> n2 >> c1 >> c2 >> c3
>> r1 >> c4 >> n2 >> r2;
I understand that inStream uses <fstream> and basically its like cin in <istream> . Am i correct to say that the >> reads a variable and skips paast the newlinw,blanks, etc.... Can anyone give me an example since the answers i have which were n1=54, n2=90 c1='E', c2='1', c3='-', r1=6.78, c4='$', n2=90 and r2=error
A similar problem like #13 is as follows.
inStream >> n1 >>r1 >> r2 >> c1 >> n2 >> n3;
the books answers are:
n1=54, r1=32E1 r2=-6.78 c1='$' n2=90 and n3=1.
This doesn't make much sense so can anyone pls enlighten me.