devxlogo

ASCII Values

ASCII Values

Question:
How do I change an ASCII value to a letter in C++?

Answer:
You can directly assign the ASCII vlaues to a variables of type char.The decimal value is automatically converted to char, without anyspecial casting operations. For example, the ASCII value of the ‘A’ is65. You assign this value to a char variable like this:

  char c = 65;  cout << c; // display A  c = 97; // ASCII value of lowercase a  cout << c; // display a

Editor’s note: this answer has been updated from the original version.

See also  How to Block Websites During Certain Hours on a Mac Computer
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist