0

what is variable?

4th Jul 2016, 4:42 PM
murali
2 Réponses
0
It's an entity wich has a type and an identifier ( a name ) and stores a value. That variable also has an address. The simplest way of declaring it is: type name = expressionWichReturnsAnObjectOfTypetypeOrSimilar; or type identifier; if you dont want to initialize it to a value. Here you are creating a variable "name" with type "type" and initialize it to the value of that expression. Then you use it writing the identifier.
4th Jul 2016, 6:09 PM
Garme Kain
Garme Kain - avatar
0
A variable stores a value. There are some. variable types, depending on what the variable stores. The basic variable types are: -int ( integer ) - long ( or long long ) ( bigger integer ) - char ( a single character ) - string ( one or more characters ) ( it can be NULL ) eg: int integer = 8; long long a = 3000000000; char letter = 'c'; string nickname = "nickname here";
4th Jul 2016, 9:39 PM
Mihai Dancaescu
Mihai Dancaescu - avatar