Read Specific Entry From Text File
问题 This is the text file named "TextFile.txt" Stat Rain 1 16 2 34 3 24 4 23 5 21 6 19 7 17 8 35 9 27 And here is my c++ code: #include<iostream> #include<fstream> using namespace std; char Station[9]; char Rainfall[9]; int i; int j; int s[23]; double r[23]; main() { ifstream Read; Read.open("TextFile.txt"); Read>>Station;//I don't want this Read>>Rainfall;//I have no choice then I just assign these two variables i=0; while(!Read.eof())//This is the only I want { i++; Read>>s[i]>>r[i]; } Read