answersLogoWhite

0

How do computers treat variables?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

A variable is simply a named value that can be altered by the program. The name is a reference to the memory location where the variable is stored. At compile time, the names are stripped and replaced with memory offsets relative to the program's starting address, referring to memory within the program's data segment, the stack. Dynamic variables cannot be replaced with offsets since they do not exist at compile time. Thus memory is set aside within the program's data segment to store the memory addresses of each dynamic variable and the dynamic variable names are replaced with those data segment offsets. Complex objects are also variables and the memory offsets for an object's members must be stored in an array within the program's data segment. Thus the same array can be re-used for all objects of the same class. Ultimately there are no named variables in machine code, only memory addresses or memory offsets. Constants are treated similarly as machine code does not differentiate a constant from a variable. The term constant is simply an aid to programming, giving the programmer some assurance that a variable will not be altered inadvertently by code outwith his control.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do computers treat variables?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Who are the users of supercomputers?

There are so many variables to climate and weather climatologists make use of these computers.


How do you find LCM with variables and exponents?

Example: 3x4y2 and 9x3y5 Treat the whole numbers normally. The LCM of 3 and 9 is 9. Choose the highest value of the variables. In this case, the LCM is 9x4y5


How do you find the LCM of two monomials with variables and exponents?

Example: 3x4y2 and 9x3y5 Treat the whole numbers normally. The LCM of 3 and 9 is 9. Choose the highest value of the variables. In this case, the LCM is 9x4y5


What do computers mapmakers digitize map data so that they can?

The main purpose is to add further layers to make digitised maps based on other variables.


How do you subract polynomials example 18a-14a?

32


How long do mac book airs last for?

It depends on how you use it and how you treat it. There are still some perfectly operable computers from the 80's and 90's because the owners treat them with care.


Explain reference variable and how it is different from pointer variable?

In JAVA, all variables are reference variables, and there are no pointer variables. Even though the platform may implement them as pointers, they are not available as such. In C, no variables are reference variables. They are a C++ enhancement. In C++ a reference variable is syntactically the same as a pointer variable, except that the use of the indirection operator (*) is implicit. You do declare reference variables slightly differently than pointer variables but, once you do so, they can be treated as non-pointer variables. Reference variables also cannot be redefined once they have been initialized to point to some object. They are const. Structurally, there is no difference between a pointer variable and a reference variable. They are both still pointers. The compiler just makes it easier to treat reference variables and non-pointer variables the same way.


What is the definition of a computer program?

An organized list of instructions that, when executed, causes the computer to behave in a predetermined manner. Without programs, computers are useless.A program is like a recipe. It contains a list of ingredients (called variables) and a list of directions (called statements) that tell the computer what to do with the variables. The variables can represent numeric data, text, or graphical images.


How do computers help astronomers understand what happens when galaxies collide?

By translating the math model of a galaxies and a galaxy collisions into a simulation. And theoritically observe the process by experimenting with the variables.


What has the author James Treat Anderson written?

James Treat Anderson has written: 'Digital computer solution of complex transient heat transfer problems' -- subject(s): Transmission, Electronic digital computers, Heat


What are the five weather variables that are collected by weather service computers in order to predict weather patterns?

Temperature, barometric pressure, wind speed and direction, precipitation, and humidity and dew point.


Since there is something called a partial derivative in calculus is there a partial integral?

Certainly. It uses the same symbol as the full integral, but you still treat the other independent variables as constants.