C++ alapok - 11. rész Írjunk fájlba C++-al

 Ebben a videóban bemutatásra kerül hogyan lehet fájlba írni egy vagy több sort


Forráskód:

#include <iostream>

#include <fstream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

using namespace std;

int main(int argc, char** argv) {

ofstream cica("vau.txt");

// cica<<"HAJRÁ VIDI!!!

// cica<<"HAJRÁ ARSENAL!!!"<<endl;

//cica<<"HAJRÁ ARSENAL!!!";

for(int i=0;i<1000;i++){

cica<<"HAJRÁ PAOK!!!"<<endl;

}

cica.close();

return 0;

}


Videó: