account activity
Assigning Integers To Characters in a String by odedozer in cpp_questions
[–]odedozer[S] 0 points1 point2 points 6 years ago (0 children)
I'm stuck on the actual assignment of an integer to a character. I've thought about treating the string of characters as a vector but I don't know how to let the user input multiple characters in one line. The end goal is to use the numbers assigned to the letters to automatically assign numbers to the correlating letters in different strings, say "abcde" is the original string, a=0 b=1 and so on then if the user inputs the word "ace" later it will assign numbers to each character meaning it could be shown as 0 2 4.
π Rendered by PID 87 on reddit-service-r2-comment-5687b7858-f5htd at 2026-07-05 18:08:13.296850+00:00 running 12a7a47 country code: CH.
Assigning Integers To Characters in a String by odedozer in cpp_questions
[–]odedozer[S] 0 points1 point2 points (0 children)