#include #include <fstream> using namespace std; int main() { double pi = 3.1415926; ofstream fileOut( "pi.bin", ios::out | ios::binary ); fileOut.write( (const char*)&pi, sizeof( pi ) ); fileOut.flush(); // ne pas oublier ou close(); pi = 0.0; ifstream fileIn( "pi.bin", ios::in | ios::binary ); fileIn.read( (char*)&pi, sizeof( pi ) ); cout << "PI : [" << pi << "]\n"; }
ifstream fichiero("fichier.txt"); while (!fichiero.eof()) { fichiero >> buf; // Traitement } fichiero.close();
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question