![](https://i-blog.csdnimg.cn/blog_migrate/6f8e31f3b4f1e727497de18197de0591.png)
c++变量
In this section we will be studying the concepts of variables in C++ programming language. We hope you guys must have heard about variables in C or somewhere else. Though it is not a very complex topic to discuss in detail but let’s see what we have to say for this.
在本节中,我们将研究C ++编程语言中变量的概念。 我们希望你们一定听说过C或其他地方的变量 。 尽管讨论不是一个非常复杂的话题,但让我们看看我们要说些什么。
C ++变量 (C++ Variables)
We can see a variable as a ‘source of storage with some name’, which our programs can use for modification or manipulation. There is always a type associated with each variable which we need to specify at the starting of the program during variable declaration or we can also specify the type of the variable during initialization of that particular variable.
我们可以将变量视为“具有某些名称的存储源”,我们的程序可以将其用于修改或操作。 总是有与每一个我们需要指定在程序的变量声明在起动或我们也可以是特定变量的初始化期间指定变量的类型变量相关联的类型 。
The type of a variable determines the size of the variable’s memory ( i.e. how many bits can be accommodated within), layout of the memory, range of values that can be stored and the set of instructions that are permissible to be applied over the variable.
变量的类型决定了变量的内存大小(即,可以容纳多少位),内存的布局,可以存储的值的范围以及允许在变量上应用的指令集。
Things to keep in mind when naming a variable:
命名变量时要记住的事情:
Digits, letters and an underscore character is what allowed in the nomenclature of the variables whereas the variables name must start with a letter or an underscore only. C++ is a c