I have a txt file with numbers like 541399.531 261032.266 16.660 (first line) 541400.288 261032.284 16.642 (2nd line)........hundred of points. i want to convert this file i
#include #include using namespace std; int main() { char buffer; ifstream in("text.txt"); ofstream out("binaryfile.bin", ios::out|ios::binary); int nums[3]; while (!in.eof()) { in >> nums[0] >> nums[1] >> nums[2]; out.write(reinterpret_cast(nums), 3*sizeof(int)); } return 0; }