Questions about this topic? Sign up to ask in the talk tab.
Difference between revisions of "Variable"
From NetSec
| Line 1: | Line 1: | ||
Something that contains data, for example, if you declare a variable "int x = 1", the variable <b>x</b> will contain the <b>int</b>eger value of <b>1</b>. | Something that contains data, for example, if you declare a variable "int x = 1", the variable <b>x</b> will contain the <b>int</b>eger value of <b>1</b>. | ||
| − | + | ||
| + | A variable is a storage location for something which holds a value which could be either known or unknown. It can be/is liable to change and is not persistent. We can set data to names and these are our variables. For example: | ||
| + | |||
| + | <code>Name = "This is a string"</code> | ||
| + | |||
| + | In programming, there are many different ways to do this in a lot of different languages. Some have limits to how much data the variable can store and others are unlimited. | ||
| + | The variable will hold the data assigned to it until a new value is assigned or the program holding it is finished. | ||
Revision as of 23:39, 29 September 2012
Something that contains data, for example, if you declare a variable "int x = 1", the variable x will contain the integer value of 1.
A variable is a storage location for something which holds a value which could be either known or unknown. It can be/is liable to change and is not persistent. We can set data to names and these are our variables. For example:
Name = "This is a string"
In programming, there are many different ways to do this in a lot of different languages. Some have limits to how much data the variable can store and others are unlimited. The variable will hold the data assigned to it until a new value is assigned or the program holding it is finished.