Create a program that will accept a character and display its ASCII value.

Recommended Answers

All 3 Replies

I'm not going to do your homework for you, but here is a way to output a char's numerical respresentation:

std::cout << (int)someChar;

To output in hex: std::cout << std::hex << (int)someChar;

The function toascii can show ASCII values too: int toascii(int c);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.