0

Can you input numbers from 0 to 9 using char?

30th Aug 2019, 4:02 PM
Rishini Fernando
Rishini Fernando - avatar
7 Réponses
+ 1
char is text, int is number. You won't calculate a text normally, but you can "convert" text into number by ASCII table. You can find it on the Internet.
30th Aug 2019, 4:28 PM
你知道規則,我也是
你知道規則,我也是 - avatar
+ 1
Do you mean an array of characters from 0 to 9?
30th Aug 2019, 4:14 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
No just one number
30th Aug 2019, 4:16 PM
Rishini Fernando
Rishini Fernando - avatar
0
As characters
30th Aug 2019, 4:20 PM
Rishini Fernando
Rishini Fernando - avatar
0
Alright maybe you want something like this: char arr[10]="0123456789";
30th Aug 2019, 4:21 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Yeah sorry if I wasn't clear. But is there any difference in char and int like not being able to calculate if I use char?
30th Aug 2019, 4:25 PM
Rishini Fernando
Rishini Fernando - avatar
0
Ok thankyou😊
30th Aug 2019, 4:30 PM
Rishini Fernando
Rishini Fernando - avatar