下载此文档

C中的auto、static、register和extern的区别.doc


文档分类:行业资料 | 页数:约7页 举报非法文档有奖
1/7
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/7 下载此文档
文档列表 文档介绍
C 中的 auto、static、register 和 extern 的区别
The difference between auto, static, register, and extern in C
Each variable annd B or 0?. So the program outputs 7, 8, 9.
Static can also declare functions, eg:static, int, fun (int, a, int, b), called fun as internal functions, or static functions. The use of an internal function is limited to the file in it, and the internal functions of the same name in each file do not interfere with each other.
Register variables: general variable values are stored in memory, (when the program needs to be used where the value of a variable, the controller sends out the instruction to the variable memory value to the operation is finished if you need to deposit, then the data is sent to the memory storage. From the computing device) So it leads to a problem, if we are a frequent operation, the stored variables must spend a lot of time, so the C language allows the local variable values stored in registers, so when you need to move directly, do not need to have memory. Increase computing speed.
Extern declares external variables: external variables (i. e. global variables) are defined outside of the function.
The scope starts with the definition of the variable and ends at the end of the program file. You can declare external variables in a file, such as:
Main ()
Extern, A, B:
Printf ("%d”, "Max” (A, B));
) int, A=13, B=-8:
You can also decl

C中的auto、static、register和extern的区别 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数7
  • 收藏数0 收藏
  • 顶次数0
  • 上传人蓝天
  • 文件大小85 KB
  • 时间2022-05-20