#include <stdio.h>
int aa();
int bb();
int main()
{
char *str1;
char *str2;
str1 = aa();
str2 = bb();
printf("str1 = %s\n ",str1);
printf("str2 = %s\n ",str2);
}
int aa()
{
char str[] = "hello world";
return str;
}
int bb()
{
char *str = "hello world";
return str;
}
输出结果:
str1 = (null)
str2 = hello world
Process returned 0 (0x0) execution time : 0.134 s
Press any key to continue.
解释: