加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c中的“auto”关键词概念

发布时间:2020-12-16 03:20:39 所属栏目:百科 来源:网络整理
导读:你能否在C程序中给出关键字“auto”的确切概念. 当我通过一本书“深C秘密”,得到以下报价. The auto keyword is apparently useless. It is only meaningful to a compiler-writer making an entry in a symbol table—it says this storage is automaticall
你能否在C程序中给出关键字“auto”的确切概念.

当我通过一本书“深C秘密”,得到以下报价.

The auto keyword is apparently
useless. It is only meaningful to a
compiler-writer making an entry in a
symbol table—it says this storage is
automatically allocated on entering
the block (as opposed to global static
allocation,or dynamic allocation on
the heap). Auto is irrelevant to
other programmers,since you get it by
default.

解决方法

auto不是数据类型.它是一个存储类说明符,如静态.它基本上与静态相反,当在局部变量上使用时,表明变量的生命周期等于其范围(即,当它超出范围时,它被自动破坏).

您不需要将auto指定为唯一允许使用它的地方,它也是默认值.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读