lab_c!

#include<stdio.h>

hi()
{
    printf("hello world!\n");
}

int main()
{
    hi();

    int i = hi();
    printf("%d\n", i);
    /* 没有void的时候默认返回值为int, 结果i = 13 ???!!!??!?!?! */
}

 code 2:

#include<stdio.h>

int result(int x)
{
    result = x * x;           // c语言不支持这种写法哦~,改为return(x * x);
}
int main()
{
    int x = 4;
    
    printf("%d\n", result(x));
}

 

posted @ 2016-11-07 21:25  xkfx  阅读(203)  评论(0编辑  收藏  举报