阅读背景:

通过例子看数组与指针的区别

来源:互联网 
#include <stdio.h>

char *fun(void)
{
    char str[] = "hello world !/n";//gcc编译不通过,pointer_arrary.c:7: warning: function returns address of local variable
   // char *str = "hello world !/n";//返回hello world !
    return str;
}

int main(int argc,char *argv[])
{
    char *a = fun();
    printf("%s",a);
    return 0;
}#include <stdio.h>

char *fun(void)
{
    char 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: