Can someone please tell me where my mistake is? Thanks!
Int the second picture, First, you're printing the string length of the string input by user. Second, to print the integer value of a char, don't do this:
int x = 's'
The quotes shouldn't be there. just do this:
int x = s
the value of
x is now a char value of the 0th character in the string
S That's why you're getting that long number output.
In your first Picture, remove the signle quotes
' from which is probably at line number 31,
int u_letter = `plaintxt[i]`;
If you put
', your are trying to pass a character not the value of
In your second Picture, you also did the same mistake.
string e = 'abc';
char a = 'e';
now a does not have first letter of string e but 'e' itself. If you want to pass the value
char a = e; // without quotes you can acccess the value at index 0.