Como crear archivos de texto en C++ | El Informatico
Como crear archivos de texto en c++
Hola gente como estan estoy devuelta por aka con un nuevo tutorial y code, sobre como crear archivos de texto en c++, usando la libreria (fstream) que incluye salida y entrada de datos.
Aqui les dejo el codigo:
#include <iostream>
#include <fstream>
#include<stdlib.h>
using namespace std;
int main()
{
char cadena [30];
int x=0;
ofstream tutorial("tutorial.txt");
tutorial <<"no entieno "<<endl;
tutorial <<"Que hago "<<endl ;
tutorial.close();
tutorial.close();
ifstream canal("tutorial.txt");
canal.getline(cadena,30);
while (x<20)
{
cout<<cadena[x];
x++;
}
return 0;
}
Si necesitan un video para la explicacion del codigo pueden verlo aqui;


Congratulations @vyvyrruz! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word
STOPDo not miss the last post from @steemitboard:
Congratulations @vyvyrruz! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word
STOPDo not miss the last post from @steemitboard: