Created
March 6, 2019 21:29
-
-
Save leandrobmarinho/4a6b99579a0ee992afa75f229883303f to your computer and use it in GitHub Desktop.
Here is a simple program in C++ to read a file using ifstream.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Suppose the file has these values | |
inf1 inf2 | |
*/ | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main () { | |
ifstream infile("filename"); | |
string first, second; | |
infile >> first >> second; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment