C++ Convert int to char and get ASCII Value

April 22, 2010

If you are wanting the ASCII value for an integer simply do a typecast of the int to a char.

int i = 65;
cout << (char)i;

Your output should be "65"

One thought on “C++ Convert int to char and get ASCII Value

  1. Joseph (October 23, 2012)

    Generally I don’t learn article on blogs, however I would like to say that this write-up very pressured me to check out and do so! Your writing taste has been amazed me. Thanks, quite great article.