Sponsored Content
Full Discussion: while ..until
Top Forums Programming while ..until Post 28594 by darkspace on Friday 20th of September 2002 12:45:54 PM
Old 09-20-2002
OR

Sorry,

but he said chr== ' ' OR chr == '<'. And you say && which means AND, therefore you will never find a char which is both: ' ' AND '<'.

I think you have to use || which means OR instead of && (= AND)!

Also if you use "do { .. } while(..)" , the pointer gets decremented and afterwards compared to the while statement. Therefore you loose the first character.

Better use:

while(chr != ' ' || chr !='<') {
chr--; // or *chr-- whatever is reqd.
}

Here the value of the pointer gets compared first and then decremented!


hope I am right,

have fun
darkspace
 
All times are GMT -4. The time now is 06:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy