Created
December 1, 2015 10:37
-
-
Save bytepicker/f2efd631bf57049f12e7 to your computer and use it in GitHub Desktop.
small type analog
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
#include <iostream> | |
#include <fstream> | |
#include <string.h> // strcat | |
using namespace std; | |
int main(){ | |
char name[100]; | |
char ch; | |
for(;;){ | |
cout<<"enter filename: "; cin >> name; | |
strcat(name, ".txt"); | |
ifstream infile(name); | |
if(infile){ | |
cout << "file opened!\n"; | |
cout << infile.rdbuf(); | |
cout << endl; } | |
else{ | |
cout << "error opening file!\n"; } | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment