#include <stdio.h> #include <string.h> char* test(char* source) { char t[]="这个准备返回给主函数"; strcpy(source,t); return source; } int main(int argc, char* argv[]) { char a[100]={'\0'}; printf("%s\n",test(a)); return 0; }
#include <stdio.h> char* test(char *source) { source[100]="这个准备返回给主函数"; return source; } int main(int argc, char* argv[]) { char h[100]={'\0'}; printf("%s\n",test(h)); return 0; }