Last active
August 29, 2015 14:02
-
-
Save foxoman/a46f082b18773aa6bec2 to your computer and use it in GitHub Desktop.
OPENING FILE USING CONSTRUCTOR in C++
This file contains hidden or 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
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main() | |
{ | |
string myDBString; | |
ifstream myDB("DB.text"); | |
getline(myDB,myDBString); //read the first line | |
cout << myDBString << endl; | |
myDB.close (); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment