Check out example codes for "c++ read integers from file". It will help you in understanding the concepts better.

Code Example 1

int main() {
	
    ifstream file("o.txt");
  	
    int num;
    while (file >> num){
      //whatever you need to do
    }
  	
}

Learn ReactJs, React Native from akashmittal.com