C++ program (Code Snippet) - Get ASCII of a Character
Let’s consider the following example:
/*C++ program to print ASCII value of a character*/
#include<iostream>
using namespace std;
int main(){
char x;
x='A';
cout<<"ASCII value of "<<x<<" is "<<(int)x<<endl;
return 0;
}
C++ program (Code Snippet) - Get ASCII of a Character
Let’s consider the following example:
Output