“变量"的定义是什么? [英] What is the definition of a "variable"?

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

问题描述

标准指出

实体是值,对象,引用,函数,枚举数,类型, 类成员,模板,模板专业化,名称空间,参数 包装或这个.

An entity is a value, object, reference, function, enumerator, type, class member, template, template specialization, namespace, parameter pack, or this.

这意味着变量" 不是实体.

但在标准中进一步说:

每个表示实体的名称都由声明引入. 每个表示标签的名称都由goto引入 陈述(6.6.4)或标记陈述(6.1).

Every name that denotes an entity is introduced by a declaration. Every name that denotes a label is introduced either by a goto statement (6.6.4) or a labeled-statement (6.1).

通过引用以外的引用的声明来引入变量 非静态数据成员或对象.变量名称表示 引用或对象.

A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable’s name denotes the reference or object.

我从这两个引号中假设变量是一个名称.

I'm assume from this two quotes that a variable is a name.

这是因为变量是由引用声明引入的,每个表示实体的名称都是由声明引入的. 但是变量的名称是什么意思?根据定义,变量也是一个名称.

It is because the variable is introduced by declaration of reference and every name that denotes entity introduced by a declaration. But what does a variable's name mean? A variable is also a name by definition.

推荐答案

我从这两个引号中假设变量是一个名称.

I'm assume from this two quotes that a variable is a name.

否,根据您提供的引号,变量是具有名称的对象或引用.

No, from the quotes you provided, a variable is an object or a reference which has a name.

这是因为变量是由引用声明引入的,每个表示实体的名称都是由声明引入的.

It is because the variable is introduced by declaration of reference and every name that denotes entity introduced by a declaration.

该声明同时引入了变量(对象或引用)及其名称.这并不意味着该变量就是名称,只是这两个变量都是由声明引入的.

The declaration introduces both the variable (the object or reference), and its name. This doesn't imply that that variable is the name, just that both are introduced by the declaration.

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

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