+ 1

How to convert a code ASCII to decimal!?

in c++ .. If I have an int x='10' how to calculate​ the result ! as we know number 0 to 9 ASCII equal 48 to 57 decimal ... and after what !?

22nd Jan 2017, 10:01 PM
Mouad LBARANI
Mouad LBARANI - avatar
4 Respuestas
+ 7
Yet another mind blowing request. You cannot calculate it lol. Refer to an ASCII table, or you can always do: for (int num = 0; num < 100; num++) { cout << static_cast<char>(num); } to take a look. If you have an int x = 10, do: cout << static_cast<char>(x);
22nd Jan 2017, 10:44 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
shannon formula. thats one if you know how to use it
23rd Jan 2017, 12:29 AM
Wen Qin
Wen Qin - avatar
0
I didn't get correctly what you are asking for it seems like you are asking for string to integer conversion. for string to integer conversion you can use standard library include <stdlib.h>; then use atoi function like this int number = atoi("56");
22nd Jan 2017, 10:21 PM
Keshave Jat
Keshave Jat - avatar
0
I mean how can I calculate it without machine .. etc ! and thx for ur answer 😊
22nd Jan 2017, 10:25 PM
Mouad LBARANI
Mouad LBARANI - avatar