Guest User

Untitled

a guest
Oct 23rd, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     char word[32];
  6.     int x = 0;
  7.     cout << "Please enter the word (maximum 32 characters):\n";
  8.     cin >> word;
  9.     cout << "The ASCII for this word is:\n";
  10.     while (word[x] != '\0')    // While the string isn't at the end...
  11.     {
  12.         cout << int(word[x]);    // Transform the char to int
  13.         x++;
  14.     }
  15.     cout << "\n";
  16.     return 0;
  17. }
Add Comment
Please, Sign In to add comment