>Can anybody help me with an efficient C-Algorithm for this conversion?
printf directly supports printing characters, decimal, and hexadecimal, so that's easy. Converting between ASCII and EBCDIC is also easy and highly efficient if you use two conversion tables:
unsigned char ascii[] = {
/* All characters in ASCII */
};
unsigned char ebcdic[] = {
/* All characters in EBCDIC */
};
unsigned char to_ascii ( unsigned char c )
{
return ascii[c];
}
unsigned char to_ebcdic ( unsigned char c )
{
return ebcdic[c];
}
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004