+ 1

How can I have multiple outputs when I input. Check the code below:

https://code.sololearn.com/cKWobw9bV8q1/?ref=app

30th Apr 2020, 4:22 PM
The Unknown
The Unknown - avatar
6 Respuestas
+ 3
As you want more than one character I would use character pointer: https://code.sololearn.com/cIA51Wn9sZbP/?ref=app If you know enter abd the output is 124.
30th Apr 2020, 4:39 PM
Alexander Thiem
Alexander Thiem - avatar
+ 2
You have to use strings for that. For that you can either use array of characters or std::string for that purpose Here I have used std::string 👇 https://code.sololearn.com/cM1Hp7oZYDf8/?ref=app here I have used old C style strings(array of characters)👇 https://code.sololearn.com/c29jZaX4016j/?ref=app
30th Apr 2020, 4:26 PM
Arsenic
Arsenic - avatar
+ 2
Oh now I understood your problem. All you need to do is type cast them to integers(as all characters are stored as their ASCII values in system) and subtract 'a' from it to get relative value from 'a' Here👇 https://code.sololearn.com/cI8SStAIiw5S/?ref=app
30th Apr 2020, 4:33 PM
Arsenic
Arsenic - avatar
+ 1
Could you reformulate your question?? I dont get what you want.... There is only one output in the code
30th Apr 2020, 4:24 PM
Alexander Thiem
Alexander Thiem - avatar
+ 1
I want to create a program in which for example when I write the letter a I get number 1, when i write the letter b i get number 2 But the problem is if I wanted to enter those two in one input it won't give 1 and 2 it won't give anything. How to fix rhow problem?
30th Apr 2020, 4:29 PM
The Unknown
The Unknown - avatar
+ 1
Thank you for the answer everyone.
30th Apr 2020, 5:11 PM
The Unknown
The Unknown - avatar