| | |
Algorithm for EBCDIC to ASCII Conversion
Thread Solved
![]() |
•
•
Join Date: Aug 2008
Posts: 11
Reputation:
Solved Threads: 0
Hello,
The Hexadecimal value of EBCDIC has to be converted to corresponding character as the user inputs it.
The following table shows the hexadecimal value of characters in ASCII and EBCDIC.
Can anybody help me with an efficient C-Algorithm for this conversion?
Char----Deci-------Hex.ASCII---Hex.EBCDIC
A ------65---------41------------- C1
B-------66---------42-------------C2
C-------67---------43-------------C3
D-------68 ---------44-------------C4
E-------69----------45-------------C5
F-------70----------46-------------C6
Thank you very much in advance.
Regards,
Sahana
The Hexadecimal value of EBCDIC has to be converted to corresponding character as the user inputs it.
The following table shows the hexadecimal value of characters in ASCII and EBCDIC.
Can anybody help me with an efficient C-Algorithm for this conversion?
Char----Deci-------Hex.ASCII---Hex.EBCDIC
A ------65---------41------------- C1
B-------66---------42-------------C2
C-------67---------43-------------C3
D-------68 ---------44-------------C4
E-------69----------45-------------C5
F-------70----------46-------------C6
Thank you very much in advance.
Regards,
Sahana
>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:
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:
c Syntax (Toggle Plain Text)
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]; }
I'm here to prove you wrong.
![]() |
Other Threads in the C Forum
- Previous Thread: Need help changing the address of an array
- Next Thread: Problem Creating Window
| Thread Tools | Search this Thread |
* adobe ansi api array asterisks binarysearch calculate centimeter char character cm convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile createprocess() csyntax directory feet fflush fgets file floatingpointvalidation fork frequency function givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches infiniteloop interest intmain() iso keyboard kilometer km linked linkedlist linux linuxsegmentationfault list locate lowest match meter microsoft mqqueue mysql number oddnumber odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc program programming pyramidusingturboccodes read recv recvblocked repetition reversing scanf scheduling segmentationfault send single socketprograming socketprogramming stack standard string suggestions systemcall unix urboc user variable voidmain() wab whythiscodecausesegmentationfault win32api windows.h






