#include
#include
char s[80]
int i;
int main (){
strcpy(s, "hi there");
i=0;
while(s [i] !='&'){
i ++;
}
i ++;
while(s[i] !='&'){
i++;
}
printf(" i=%d\n",i);
}
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 12, 2012, 8:30 PM
On the second point, there are number of issues but this should compile and print something sensible:
sami samPosted Aug 12, 2012, 8:25 PM
sami samPosted Aug 12, 2012, 8:22 PM
VulpesPosted Aug 12, 2012, 8:13 PM
If you don't do this, then you'll get a silly answer as the while loops keep on iterating until they find a '&' in memory.