什么是自动变量? [英] what are automatic variables?

查看:115
本文介绍了什么是自动变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何实现自动变量以及那些????

how to implement automatic variables and also what are those????

推荐答案

这个问题并不完全错误,但可以大大改进。你应该重新制定它:



什么是维基百科,谷歌,CodeProject和StackOverflow.com?
如果你问过并得到了很好的答案,就不需要像原来那样的问题!



这不是你的第一个问题。如果你打算以同样的方式行事,那就不会让你走得太远。



首先,请看:http://en.wikipedia.org/wiki/Automatic_variable [ ^ ]。



顺便说一句,另一个谬论是学习单独的概念。没有什么可以取代对编程和语言的系统学习。



-SA
This question in not completely incorrect, but can be greatly improved. You should have re-formulated it:

"What are Wikipedia, Google, CodeProject and StackOverflow.com?"
If you asked and got good Answers, the Questions like your original one would not be needed!

This is not your first question of that sort. If you are going to proceed the same way, it won''t take you far.

To start, please see: http://en.wikipedia.org/wiki/Automatic_variable[^].

By the way, another fallacy is learning separate notions. Nothing can replace systematic study of programming and languages.

—SA


你标记为C 作为您感兴趣的语言,但在C ++中,auto有一个新的上下文含义,其中变量的类型(在等号的左侧)可以从表达式推断出来(在相等的右侧)标志)。这在该语言的最新C ++ 11版本中可用。例如,你可以说

You flagged "C" as your language of interest, but in C++ there is a new contextual meaning for "auto", where a variable''s type (on the left of an equal sign) can be inferred from the expression (on the right of an equal sign). This is available in the latest "C++11" version of the language. For example, you can say
auto x = 5;



,编译器将确定''''是一个int。这不是(还是?)C语言的一个特征。



我认为谢尔盖在解决方案#1中的注释(here) [ ^ ]详细描述了详细信息。


and the compiler will determine that ''x'' is an int. This is not (yet?) a feature of the "C" language.

I think Sergey''s note in Solution #1 (here)[^] describes the details well.


这篇关于什么是自动变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆