C programming help ....
Ben Duncan
bend at linux4ms.net
Sun Aug 23 13:49:40 PDT 2009
Ok, i have a question for the MORE advanced C programmers.
I want to loop thru a string of characters that may contain some
"high values", i.e. 0xFF and possible use the & function to test that.
Lets say "^" represents the HIGH value mark and the string looks like this:
ABCDEFG^THIS IS A LONG STRING OF DATA^MORE DATA HERE^1234567890^EOF STRING^\0"
I want to be able to do something like this:
int idx ;
char MyString [256] ; /* See above string */
for ( idx = 0 ; idx < strlen (MyString) ; idx++
{
if ( Mystring[idx} & 0xFF )
printf ("High value found at: %i ", idx)
}
Is this the correct way to do this ?
Thanks ...
--
Ben Duncan - Business Network Solutions, Inc. 336 Elton Road Jackson MS, 39212
"Never attribute to malice, that which can be adequately explained by stupidity"
- Hanlon's Razor
More information about the Linux-users
mailing list