69,379
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
char *fun(char *p)
{
return p;
}
int main(void)
{
char *p="123454";
printf("%s\n",fun(p));
system("pause");
return 0;
}
void encode(char *c) //直接写入传入的参数
{
strcpy(c, "hello");
return ;
}
//or
char * encode()
{
char *p = new char [100];
strcpy(c, "hello");
return c;
} //do not forget free c!
char encode(c)
{
return c;
}
char* encode(c)
{
static char * p = "test";
return p;
}