Ма
Мария

как считать бинарный файл у C++. ifstream не работает=( подскажите код

На
Настя

ifstream таки работает. Пользуйся блочными функциями, а не форматными.

istream& read ( char* s, streamsize n );

Read block of data
Reads a block of data of n characters and stores it in the array pointed by s.

If the End-of-File is reached before n characters have been read, the array will contain all the elements read until it, and the failbit and eofbit will be set (which can be checked with members fail and eof respectively).

Notice that this is an unformatted input function and what is extracted is not stored as a c-string format, therefore no ending null-character is appended at the end of the character sequence.

Calling member gcount after this function the total number of characters read can be obtained.

Похожие вопросы
Подскажите почему код не компилируется? (код на C/C++)
c++ std::ifstream причина ошибки...
Подскажите код в c++!
Как считать весь stdin/файл в c++?
Работа с файлами c++ 3.1. есть кусок кода : ifstream file2("text2.txt"); while (!file2.eof()) { file2<
признак бинарного или текстового файла.
Как при считывании файла потоком ifstream считать файл до конца? C++
C++ считать float числа из файла
как дозаписать в бинарный файл? язык с
c++ Как из файла считать строку N