Код: Выделить всё
#include
int main() {
std::ofstream out;
out.open( "bin.dat", std::ios::out | std::ios::binary);
float f = 0.5;
out.write( reinterpret_cast( &f ), sizeof( float ));
out.close();
return 0;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... alent-to-j
Мобильная версия