Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char word[32];
- int x = 0;
- cout << "Please enter the word (maximum 32 characters):\n";
- cin >> word;
- cout << "The ASCII for this word is:\n";
- while (word[x] != '\0') // While the string isn't at the end...
- {
- cout << int(word[x]); // Transform the char to int
- x++;
- }
- cout << "\n";
- return 0;
- }
Add Comment
Please, Sign In to add comment