1) How can i put a new line when i write two record? For example, if i put two "fsalida.write" in the program, it not generates two records, it puts one continuos to other. I tried with "\n" but does not work well.
2) The char buffer for "TER" has 273 characters, but i need only 272 (B count). If i use only 272 in char buffer, the program crash.
3) When in open with notepad++ the file, i see binary characters at the end of the record. I spected see the record finish with B.
If you're trying to produce a file in a specified format (241 character string, 8 64-bit numbers, 272-character string, endline), that's exactly what you should do. Your program produces a file that contains the binary representations of struct objects, which is not the same thing.
if you'd like to keep it in a struct, you could give it its own operator>>, and use that: