zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然C语言开发:存储类

    {
       int mount;
       auto int month;
    }
    {
       register int  miles;
    }
    #include <stdio.h>
     
    /* 函数声明 */
    void func1(void);
     
    static int count=10;        /* 全局变量 - static 是默认的 */
     
    int main()
    {
      while (count--) {
          func1();
      }
      return 0;
    }
     
    void func1(void)
    {
    /* 'thingy' 是 'func1' 的局部变量 - 只初始化一次
     * 每次调用函数 'func1' 'thingy' 值不会被重置。
     */                
      static int thingy=5;
      thingy++;
      printf(" thingy 为 %d , count 为 %d
    ", thingy, count);
    }
    #include <stdio.h>
     
    int count ;
    extern void write_extern();
     
    int main()
    {
       count = 5;
       write_extern();
    }
    #include <stdio.h>
     
    extern int count;
     
    void write_extern(void)
    {
       printf("count is %d
    ", count);
    }
  • 相关阅读:
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    将Ojective-C代码移植转换为Swift代码
    Swift
    房费制——报表(1)
  • 原文地址:https://www.cnblogs.com/tszr/p/10967711.html
Copyright © 2011-2022 走看看