hacktoberfest-2018/code/FILES-BINARY-IN-C-PLUS-PLUS.cpp
yaderson 021bd50202
Add FILES-BINARY-IN-C-PLUS-PLUS.cpp
FILES-BINARY-IN-C-PLUS-PLUS.cpp
2018-10-08 14:09:12 -05:00

26 lines
500 B
C++

/* WORKING FIRST FILE BINARY */
#include <iostream>
#include <fstream>
using namespace std;
int main(){
char msg[100];
ofstream escritura("File1.txt");
if(escritura.fail()){
cout<<"Error in FILE";
}else{
cout<<"FILE Successfully generated"<<endl;
cout<<"Msg: ";
fflush(stdin);
gets(msg);
escritura<<msg;
}
escritura.close();
/* cout<<"Archivo -- close"<<endl;
char ar[100];
ifstream lectura("archivo1.txt");
lectura >> ar;
cout<<ar<<endl;
lectura.close();
*/
}