Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASCII TO HEX TO ASCII

Status
Not open for further replies.

Teesan

Programmer
Dec 16, 2002
1
IE
Hello currently i am trying to write a program to take in user input and convert this input to ASCII or Hex depending on what they specify.The ASCII set in question is standard one from 0 to 127. I am wondering should i have a 2-dim array of ASCII chars and there hex equivalent. the difficulty i am finding is with special chars in the ASCII set,e.g Delete 7F.Say for example the user presses carriage return when prompted to enter the string for conversion.should i say enter string and press '999' to end as carriage return cannot be used.I am getting very stressed out with this programming problem. i am a hard worker but just cant seem to get over this problem. Hope the legends out there can help.
thank you very much
 
Using a 2dim array is not worth it. Strings ARE in ASCII, so if you have the ascii code as an integer somewhere, you just print it directly to screen, which outputs it as an ascii character. For instance, if al=65, you output an 'A.'

Your problem is much easier if you were to go directly to BIOS or hardware, but that may be more complex than you can handle. If you need to display 8, 9, 10, 13, you need to write them directly to screen. Entering these codes is another problem too.
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
CAN U HELP ME TO WRITE APROCRDUER TO READ HEXA DECIMAL DIGITS NUMBERS CONTAINIG UP 4 HEXA DECIMAL DIGITS NOTE THAT THE NO MASY CONTAIN LESS THAN 4 HEXADECIMAL DIGITS USE THE RETURN KEY AS TERMINATION CHAR TO ENTERING THE N0..

alitiger17@hotmail.com

 
THANKS
PLZZ HELP ME TO SOLVE THIS: CAN U HELP ME TO WRITE APROCRDUER TO READ HEXA DECIMAL DIGITS NUMBERS CONTAINIG UP 4 HEXA DECIMAL DIGITS NOTE THAT THE NO MASY CONTAIN LESS THAN 4 HEXADECIMAL DIGITS USE THE RETURN KEY AS TERMINATION CHAR TO ENTERING THE N0..


 
THANKS
PLZZ HELP ME TO SOLVE THIS: CAN U HELP ME TO WRITE APROCRDUER TO READ HEXA DECIMAL DIGITS NUMBERS CONTAINIG UP 4 HEXA DECIMAL DIGITS NOTE THAT THE NO MASY CONTAIN LESS THAN 4 HEXADECIMAL DIGITS USE THE RETURN KEY AS TERMINATION CHAR TO ENTERING THE N0..


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top