问答详情
源自:5-10 局部与全局

#include <stdio.h> int x = 77; void fn1() { printf("fn1(): x=%d\n", x); } int main() { int x = 10; if(x>0) { static x = 100; x /= 2; printf("if语句内, x=%d\n", x); } printf("main方法内, x=%d\n", x);

#include <stdio.h>

int x = 77;

void fn1()

{

    printf("fn1(): x=%d\n", x);       

}

int main()

{

    int x = 10;

    if(x>0)

    {

         static x = 100;

        x /= 2;

        printf("if语句内, x=%d\n", x);       

    }

    printf("main方法内, x=%d\n", x);

    fn1();

    return 0;

}


提问者:我的仰视30 2015-03-28 20:52

个回答

  • UU小学生
    2015-12-18 16:19:16

    ++++++++++++++++++++++++++++