Page 1 of 1

Fixed width Binary File

Posted: Tue Jan 17, 2006 5:35 am
by nchincholikar
Hi All,

Does anybody knows how to create Fixed width Binary file.
For eg.Input Column has Datatype Long Int which is of size 4 bytes and the output has to be stored using 4 Bytes memory space only.Similar to Fwrite() function in C.

Similary a short int should be stored in 2 Bytes Memory space and a char Array [N] should be stored in N bytes of memory space.

Regards,
Narendra.

Posted: Tue Jan 17, 2006 1:03 pm
by ArndW
Fixed width is done by using CHAR and appropriate lengths, the contents of the data fields, at least when writing, is irrelevant. Numbers are written to sequential files as display formats, but if you wish the binary values to be stored then you can use the conversion for COMP-3.