Questions about this topic? Sign up to ask in the talk tab.

Difference between revisions of "Variable"

From NetSec
Jump to: navigation, search
Line 3: Line 3:
 
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:
 
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>
+
<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.  
 
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.
 
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 00:50, 30 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.