Aug 13, 2002 #1 EauDeNil Programmer Joined Aug 13, 2002 Messages 1 Location US I'm looking for a way to run through a character array and get the ascii code numbers for each letter.
I'm looking for a way to run through a character array and get the ascii code numbers for each letter.
Aug 14, 2002 #2 Leibnitz Programmer Joined Apr 6, 2001 Messages 393 Location CA you can do it like this: Code: #include <ctype.h> ..... ... char *str = "hello world !"; for( int i = 0; str[i] != 0; i++) { __toascii( str[i] ); } .... Upvote 0 Downvote
you can do it like this: Code: #include <ctype.h> ..... ... char *str = "hello world !"; for( int i = 0; str[i] != 0; i++) { __toascii( str[i] ); } ....
Aug 15, 2002 #3 xwb Programmer Joined Jul 11, 2002 Messages 6,828 Location GB char* astr = "ropey"; for (int i = 0; astr; i++) printf ("%d ", (int) astr); Upvote 0 Downvote