Answer the question
In order to leave comments, you need to log in
Is there an analogue of str.charCodeAt(index) for C++?
Need an analogue of charCodeAt from js for C++. If not, please tell me how to do the same in C++. Give an example if possible.
Answer the question
In order to leave comments, you need to log in
"For C++" is too vague.
If we are talking about single-byte strings (char[], char* or std::string), then str[idx] will be the value you need.
But only if the content is in the same single-byte encoding.
And if there, say, utf-8, then here you are unlikely to do without the appropriate library.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question