#include #include int main (int argc, char * argv[]) { std::ifstream myfile; char * filename = "exampleBinary.txt"; char buffer[29]; int value; myfile.open (filename, std::ios::in | std::ios::binary); if(myfile.is_open()) { myfile.read(buffer,29*sizeof(char)); std::cout << buffer << std::endl; for(int i = 0 ; i <= 1000 ; i++) { myfile.read((char*)&value,sizeof(int)); std::cout << value << std::endl; } } else { std::cout << "Erreur à l'ouverture du fichier "<< filename << std::endl; } myfile.close(); return 0; }
- Tuesday
- November 19th, 2024
- Ajouter un cours