answersLogoWhite

0


Best Answer

In C/C++ when we declare a variable;

e.g

int var;

for this variable (i.e. var) memory is being reserved in RAM (i.e out side processor).

If we declare variable like that;

register int var2;

for this variable memory is being reserved in register of CPU (i.e. withing processor)

But register variables are discouraged because processor has to work with registers.....

Note: strictly speaking, storage class 'register' means: dear compiler, you might optimize this variable into register, as I won't ever request its address. But of course, it's up to you to decide.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between normal variable and register variable in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is difference between partial differentation and normal diffrentation?

Ordinary Diff -> One variable Partial Diff -> More than one variable


What is the difference between pointer variable and simple variable What are the advantages of pointer variable?

normal variable stores a value of the given datatype where as the pointer variable stores the address of a variable. for example int n=10; int *p; p=&n; here p is a pointer variable and n is a normal variable.p stores the address of n where as n stores an integer value. *p prints the value of n,p prints the address of n.


Distinguish between a variable and a control?

in an experiment we usually make two or more set ups. the first set up where all the conditions are normal is known as the control. the rest of the set ups which may have different conditions is called as the variable set up.example:suppose we are performing an experiment to check the growth of plants in absence of carbon dioxide.The control will have carbon dioxide (normal condition).the variable will not have carbon dioxide.this is done for a comparison between normal and abnormal conditions.Thank you.


What is the difference between a micro pet and a normal pet?

the difference between a micro pet and a normal pet is that a micro pet is a really small animal such as a micro pig and a normal animal is a animal just like a normal person normal size normal wight and that is the difference between a normal animal and a micro animal.


What is the difference between controlling variables and using controls?

Controlling variables is when you make sure that only one variable is being tested at a time and that there are not other variables that will make your results unclear. Using a control is when you do a trial without the variable to see what the normal results are.


What is the difference between normal saline solution and ringer's lactate solution?

What is the difference between normal saline solution and ringer's lactate solution?


What is the difference between a normal and a participating preference share?

what is defference between normal and preference shares


What is the probability that a standard normal variable will be between the values of -2 and 1?

0.636 approx.


What is the difference between normal and average respiratory rate?

The difference between normal and average respiratory rate is simple. Normal is healthy and cannot change and average most certainly can change.


What the difference between a pie and tartlet?

The treatment effect is the difference between the observed outcome and the "normal" outcome


What is the difference between sowing and planting?

The treatment effect is the difference between the observed outcome and the "normal" outcome


What is the difference between a normal guitar and a junior guitar?

The difference between a normal guitar and a junior guitar is primarily its size. A Junior guitar is shorter and about three quarters the size of a normal guitar.