123456789101112131415161718
#include <iostream> #include <fstream> int main ( void ) { unsigned int i = 0; do { std::ifstream in( "example.txt" ); in >> i; in.close(); std::cout << i << std::endl; i++; std::ofstream out( "example.txt" ); out << i; out.close(); } while( i < 15 ); }
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Process returned 0 (0x0) execution time : 0.647 s Press any key to continue.