{
Ifstream inFile.
Ofstream outFile;
OutFile. Open (" my. Dat ", the ios: : out);//build output file "my dat"
Char univ []="Tsinghua", the name [10].
Int course=2401, number=0;
OutFile & lt;
if(! InFile) {
Cerr & lt; <"Can't open my. Dat" & lt;
}
Cout
InFile & gt;> The name & gt;> C & gt;> Number;
Cout
Why c display value is 2, number display value is 401
CodePudding user response:
File is 2401, the first 2 c read into the characters, and then read 401 in number