#include <stdio.h>
#include <string.h>
void trim(char * str1)
{
char *temp = (char *)str1;
if(*temp != '\0')
{
temp++;
}
return ;
}
void main()
{
char *str = "yinlang";
printf("str = [%s]\n", str);
trim(str);
printf("str = [%s]\n", str);
}
我想要的结果是
str = [yinlang]
str = [inlang]
但是实际的结果是
str = [yinlang]
str = [yinlang]
为什么,怎么才能我要的答案呢,trim的返回值还必须是void;请高手帮忙!
[[it] 本帖最后由 yinlang204 于 2008-8-20 14:23 编辑 [/it]]