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
In C++ just open the file for reading, then copy it to another file as a binary file.
FILE *pTextFile, *pBinaryFile;
char buffer;
pTextFile = fopen("textfile.txt", "r");
pBinaryFile = fopen("binaryfile.bin", "wb");
while (!pTextFile(EOF))
{
fread(buffer, 1, 1, pTextFile);
fwrite(buffer, 1, 1, pBinaryFile);
}
fclose(pTextFile);
fclose(pBinaryFile);