I'm trying to modify a counter in if loop because one array index number needs to be corresponded by the other in order for me to change the place of it's text, but the space between the strings add 1 to the counter.
for(int i = 0, n = strlen(p); i < n; i++){
if(isspace(p[i])){
c1 = x[i-1];
printf("%c", p[i]);
}
if(isalpha(p[i])){
c1 = x[i];
c2 = c1-96;
printf("%c --- %c ---%d\n",p[i],c1, c2);
}
This is one of the attempts but it made an infinite loop, I've tried different approach like:
if(isspace(p[i))){
printf("%c", p[i]);
i -= 1;
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire