int reverse(char s[]){ int i=0, i2=0, tmp='\0', tmp2=0; //how long is the string while(s[i2]!='\0'){ i2++; } tmp2=i2; // remember length for later use //debugging printf("\nLine is %d long.\n", tmp2); while(i<=tmp2){ tmp=s[i]; s[i]=s[i2]; s[i2]=tmp; i++; i2--; } //break - string should be reversed. return i; }