If your character array that is in EBCDIC format is a c-style string in that in ends with a \0
byte, then there is no problem.
fputs()
, in binary mode, is format agnostic other than it does not write a \0
.
Assuming your program is written using the ASCII char set, it is important that your output file is opened in binary mode (e. g. "wb"), else the \n
of C will not match the same in EBCDIC and some translations are possible.
On the other hand, are you going to do something with this file other than write and maybe read back?
Should your "character array that is in EBCDIC format" not end in \0
or have embedded \0
bytes, suggest you simple use fwrite()
. Again be sure to use in binary mode, unless your entire system is EBCDIC.