just like this,Is it ok?? wrap your for loop with {}
{ int i=0; char *str="abc"; for(;i<9&&*str=='a';i++,str++) { //do something } }