ASCII in the console...

So I wanted to jazz up some of my consol apps with sime ascii.. I found a few good apps that will convert an image into a ASCII file.. like this for example http://ascgendotnet.jmsoftware.co.uk/

But I need to work out how to get these as char vales...

Dose anyone know a app that will convert a image like the above one.. but instead of printing out the ascii itself it prints out the char vales for the ascii?
If your storing the character in the char data type and want to print out the charcode to an int before you print.

1
2
char letter = 'A';
cout << int(letter); //outputs 65 
'A' is read by the compiler as 0100 0001. (ascii)
65 is also read by the compiler as 0100 0001. (decimal)
0101 is read by the compiler as 0100 0001. (octal)
0x41 is read by the compiler as 0100 0001. (hexadecimal)

These are all different ways that a programmer can input the same thing so there is no difference. It just depends on what works for you.

In addition to the code above, this will work in reverse:
1
2
char letter = 65;
cout << letter;
A
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#include<iostream> // this program converts any symbol to ASCII codes.
using namespace std;

int main() {
   

char b; // character 'b'.

cin >> b; // write down the symbol to be converted into.

int x = b; // int varible makes char varible turn into ASCII codes.

cout << x;  // output the ASCII codes.



system("pause");
return 0;
}





speaking of ASCII codes,this is a very simply program that converts any character of simbol into a ASCII code....If you need it.
Topic archived. No new replies allowed.