How to find the ASCII value of a character in C++

1 Answer

0 votes
#include <iostream>

int main(void) {
    char ch = 'a';
    
    std::cout << "ASCII value of character " << ch << " is: " << (int)ch;
}




/*
run:

ASCII value of character a is: 97

*/

 



answered Feb 13, 2021 by avibootz

Related questions

1 answer 96 views
1 answer 101 views
2 answers 184 views
1 answer 129 views
...