#include
int main()
{
void reverse(char *s);
char *s = "abcdefg";
reverse(s);
return 0;
}
void reverse(char *s)
{
char *end = s;
char temp;
while(*end){
end++;
}
end--;
while(s < end)
{
temp = *s;
*s++ = *end;
*end-- = temp;
}
}
char *s = "abcdefg";
指向常量,不能這麼寫