`char *` `int`
int pal(char *s)
`0` `1` `0` `1`
#include
#include
int pal(char *s)
{
...
}
int main(void)
{
char *input = malloc(128);
int result;
sprintf(input, "%s", "abcde"); /* */
result = pal(input);
printf("input: %s\
result: %d\
", input, result);
free(input);
return 0;
}
`"abcde"` "abcd" "abcba" "aaaa"
1 1
* `while` `t` C `\0` `t` `s` 1 (`\0` )
* 2 `while` `s` `t` 1 `s` `t` `return 0` `s` `t` (`s <= t` )
* `s` `t` 1
`pal`
> `pal` ASCII `s` `1` `0` `pal` "palindrome"