Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- using namespace std;
- char chChar;
- while (1==1)
- {
- cin >> chChar;
- cout << chChar << " has ASCII code " << (int)chChar << endl;
- }
- }
- jeremy@phobos:~/programs$ ./char
- karl roesner
- k has ASCII code 107
- a has ASCII code 97
- r has ASCII code 114
- l has ASCII code 108
- r has ASCII code 114
- o has ASCII code 111
- e has ASCII code 101
- s has ASCII code 115
- n has ASCII code 110
- e has ASCII code 101
- r has ASCII code 114
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement