#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++;
}
return 0;
}
/* using a do-while statement: */
i = 10;
// this is executed once, because the continuation condition is
// not checked until after the body of the loop runs:
do {
printf("do-while: i is %d\n", i
);
i++;
} while (i < 10);
printf( "%d\n", charPlustwo
( ))
for (i = 0; i < 10; i++) {
}