Below is the source code to print ASCII value of a character entered by the user.
CPP source code to print a character’s ASCII value
#include <iostream> using namespace std; int main() { char character; //Input the character cout << "Type a character and hit ENTER: "; // Read the character cin >> character; // Print ASCII value of character cout << "ASCII Value of " << character << " is " << int(character); return 0; }
Also Check C plus plus code to remove special characters from a string [C++]