i need a little help i was wondering if anyone knows how to convert the keyboard input of a word from a user to its decimal representation or binary representation i know how to convert decimal to binary but not the characters to the decimal value

for example if the user inputs abcd it would give 97+98+99+100(ascii values)
which = 394

any help would be greatly appreciated