Add FILES-BINARY-IN-C-PLUS-PLUS.cpp

FILES-BINARY-IN-C-PLUS-PLUS.cpp
This commit is contained in:
yaderson 2018-10-08 14:09:12 -05:00 committed by GitHub
parent 3934571c6a
commit 021bd50202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
/* 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();
*/
}