mirror of
https://github.com/c0de-archive/hacktoberfest-2018.git
synced 2024-12-22 13:22:39 +00:00
Add FILES-BINARY-IN-C-PLUS-PLUS.cpp
FILES-BINARY-IN-C-PLUS-PLUS.cpp
This commit is contained in:
parent
3934571c6a
commit
021bd50202
26
code/FILES-BINARY-IN-C-PLUS-PLUS.cpp
Normal file
26
code/FILES-BINARY-IN-C-PLUS-PLUS.cpp
Normal 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();
|
||||||
|
*/
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user