Hello guys,im beginner
Im trying to reverse some texts and delete spaces.if spaces are more than one
i mean this :
hello world ---> hello world
4 spaces ---> 1 space
i tryed to reverse the texts successfully like this
Code:void reversed(char str[]); int main(int argc, char *argv[]) { char str[100]; printf("enter text : "); gets(str); reversed(str); return 0; } void reversed(char str[]) { int i; for (i = strlen(str) - 1; i>=0; i--) printf("%c",str[i]); printf("\n"); system("PAUSE"); return 0; }
but i want to delete the spaces at the same time and dont know how
Thanks.



LinkBack URL
About LinkBacks



