how to directly convert char to numbers?

Convert decimal numerals to hexadecimal:char c(int k) ?

  • this is how far i got i seriously need help char c(int k) { assert (k >= 0 && k <= 15); if (k < 10) return char(k + '0'); return char(k - 10 + 'a'); } string s(int n) { if (n == 0) return string(1,'0'); string s; while (n > 0) { s = string(1,c(n% 16)) + s; n /= 16; } return s; } donno wat's next ?? doesnt compile and need a project methdology

  • Answer:

    You're completely wrong, your code makes no sense. Read the textbook.

hoda a at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.