C 练习实例41 - static

C 语言教程 · 2019-02-21 22:13:00

题目:学习static定义静态变量的用法。

程序分析:无。

实例

// Created by www.codercto.com on 15/11/9. // Copyright © 2015年 码农教程. All rights reserved. // #include<stdio.h> int main() { void fun(); for(int i=0;i<3;i++) fun(); return 0; } void fun() { int i=0; static int static_i=0; printf("i=%d\n",i); printf("static_i=%d\n",static_i); i++; static_i++; }

以上实例输出结果为:

i=0
static_i=0
i=0
static_i=1
i=0
static_i=2

点击查看所有 C 语言教程 文章: https://codercto.com/courses/l/17.html

查看所有标签

Spring in Action

Spring in Action

Craig Walls / Manning Publications / 2011-6-29 / USD 49.99

Spring in Action, Third Edition has been completely revised to reflect the latest features, tools, practices Spring offers to java developers. It begins by introducing the core concepts of Spring and......一起来看看 《Spring in Action》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具