English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

it is pseudocode.

a variable is the name in your code that you are using. You could call it cName or iNumber or aFred or anything that you wish.

You can assign the variable with a value, it can be a string as in "nonsense" or an integer such as 1204 or a date or many things. It depends on the computer language a little.

The syntax will vary according to the language

2007-01-14 10:29:09 · answer #1 · answered by ~Mustaffa~Laff~ 4 · 0 0

I have no clue to what programming language you need the answer for, but in my world of ASP/VB programming,

You have to assign it.

So if variable = string then you have a line that says string = something.

Heres how Visual basic would be:

string = "Hi There"
or String = 550

variable is same thing as string

Since I gave a value to string, then string is now technically a variable.

ie
Myworld = "Yo"

Myworld is now a variable, the string is YO

2007-01-14 10:33:24 · answer #2 · answered by SharpGuy 6 · 0 0

Variable in any programming language is the declaration/naming of some place in memory that we will use to store some sort of value in it. Consider memory a big rewriatble papare where anybody can write on. Memory is a sort of rewritable place where progarms running on your machine do write their temporary data. When we write a program we know what we need to store and how much space it will require in memory and what will be the type of that data that we will store in memory. The result of all these questions let you decide what type of variable you will declare. If you need to srore some number you will reserve a place in memory which is sufficient to store a number, if you need to store a character you need one byte so you will reserve one byte in memory in your program, If you need a string you will declare/reserve some place in memory where many characters can be stored. Now computers have so big memory in it then why we need to reserve a few bytes for each type or data for our running programs ? Answer is that at a time many programs are running so we associate a cretain place for each program, now that associated part of memory can only be used by that program and within that part each variable is allocated its part of memory this way we associate memory for each variable. Once some byte memory is associated to some variable no other program can write on that place, only the data assigned to that particular variable will be stored there. So this make sure that data assigned by a variable by a program can't be overwritten or modified by some other variable or program.
It is same like we have so many glasses and we associate a certina glass for milk that you will drink. so when we declare a variable we basically associate/allocate a certain glass which will be used to put your drink/milk in it.

Now we have declared a variable, means associated a place [some bytes] for that variable in a part of computer memory [a part that is assigned to your program by OS]. Next step is to use that memory in your program. You can write some data on that allocated place and can read that data or can modify that data. How these operations are performed?
Say you have declared a variable like
1. declare customerName of Type String. [alocation of certain bytes in memory is done with your variable 'customerName']
2. next you write code like set customerName="Alam". This is the assigmnet statement that will actually write the data "Alam" to your computer memory at a place which was previously alovcated to the variable 'customerName' at some physical address.
3. You can also read tha data by anotherVariable=customerName
this is another statemenet which get the data from 'customerName' and copy all the contents to 'anotherVariable'.

All these allocations/associations become invalid when your local variable goes out of scope or your program is termintade/closed in case of global variables.

2007-01-14 10:45:17 · answer #3 · answered by digital 2 · 0 1

Whatever is contained in the string!

2007-01-14 10:26:35 · answer #4 · answered by tattie_herbert 6 · 0 0

the content of the string

2007-01-14 10:29:30 · answer #5 · answered by sm bn 6 · 0 0

fedest.com, questions and answers