+ 1
Can someone describe me variables in c++
Really confused in variables please help me I am a beginner and I am looking for help
5 Answers
+ 18
you can think of a variable as a container that contains a value. Each variable in C++ has a specific type, which determines the size and layout of the variables' memory;the range of values that can be stored within that memory; and the set of operations that can be applied to the variables.There are different variable types including char(1 byte), int(4 bytes), float, double,etc. As you start writing more code, it would become clearer I am sure
+ 5
Example
A=2
A is the variable
+ 1
Variable is the name of memory location allocated by the compiler depending upon the datatype of the variable.
0
variable is a one type of container which contain only one value at one time.
- 1
For example before processing raw materials are kept in some containers. Those containers are variables. After processing the finished products a re also kept in some container again these containers are variable. There will be different type of containers required for solid and liquid and gases. Similarly different data types are required to hold different types of data.