std::ifstream fs("C:/Users/wARTEMw/Desktop/object/Blender_Binary.fbx", std::ios::in | std::ios::binary ); // Узнаём размер файла fs.seekg( 0, std::ios::end ); std::size_t size = fs.tellg(); fs.seekg( 0, std::ios::beg ); // Читаем файл целиком std::unique_ptr <char[]> buf; buf.reset( new char[size] ); fs.read( buf.get(), size ); /* либо без std::unique_ptr char* buf = new char[size]; fs.read( buf, size ); и нужно не забыть освободить память delete []buf; */
when you need to display all the characters you need to consider that the output will go to the control characters, that is, if you get '\ 0', the output will stop
so if you need to display the contents on the screen or in a file, you need to label these characters like that (like in Notepad ++)
// примерно так for( int i = 0; i < size; ++i ){ if( buf[ i ] == '\0' ) printf( "[NUL]" ); else if( buf[ i ] == '\1' ) printf( "[SOH]" ); else if( buf[ i ] == '\2' ) printf( "[STX]" ); else if( buf[ i ] == '\3' ) printf( "[ETX]" ); else if( buf[ i ] == '\4' ) printf( "[EOT]" ); else if( buf[ i ] == '\5' ) printf( "[ENQ]" ); else if( buf[ i ] == '\6' ) printf( "[ACK]" ); else if( buf[ i ] == '\7' ) printf( "[BEL]" ); else if( buf[ i ] == '\n' ) printf( "\n" ); else printf( "%c", buf[i] ); }