English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i ahve been given an assignment to take a number input from user and convert it into its equivalent hexadecimal, octal and ascii values. i have done the hex and oct but i am sttruck on ascii can anyone plz help me....

2007-02-02 08:22:25 · 2 answers · asked by jijo p 2 in Computers & Internet Programming & Design

2 answers

ASC(char) should return the ascii code for a single character. If you need to be able to input multiple characters, you will have to use string manipulation and walk through the string 1 character at a time.

Best of luck!

2007-02-02 08:30:29 · answer #1 · answered by disposable_hero_too 6 · 0 0

Use the C-Standard function sprintf for those purposes: int number = 1243; char str[1024]; sprintf(str, "%i", number); That should do it.

2016-05-24 06:01:47 · answer #2 · answered by ? 4 · 0 0

fedest.com, questions and answers