C 练习实例43

C 语言教程 · 2019-02-21 22:43:57

题目:学习使用static的另一用法。 

程序分析:无。

程序源代码:

实例

// Created by www.codercto.com on 15/11/9. // Copyright © 2015年 码农教程. All rights reserved. // #include <stdio.h> int main() { int i,num; num=2; for(i=0;i<3;i++) { printf("num 变量为 %d \n",num); num++; { static int num=1; printf("内置模块 num 变量为 %d\n",num); num++; } } return 0; }

以上实例输出结果为:

num 变量为 2 
内置模块 num 变量为 1
num 变量为 3 
内置模块 num 变量为 2
num 变量为 4 
内置模块 num 变量为 3

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

查看所有标签

Dive Into Python

Dive Into Python

Mark Pilgrim / Apress / 2004-11-5 / GBP 31.49

Python is a new and innovative scripting language. It is set to replace Perl as the programming language of choice for shell scripters, and for serious application developers who want a feature-rich, ......一起来看看 《Dive Into Python》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具