Best Answer

Register variables are a special case of automatic variables. Automatic variables are allocated storage in the memory of the computer; however, for most computers, accessing data in memory is considerably slower than processing in the CPU. These computers often have small amounts of storage within the CPU itself where data can be stored and accessed quickly. These storage cells are called registers. Normally, the compiler determines what data is to be stored in the registers of the CPU at what times. However, the C language provides the storage class register so that the programmer can ``suggest'' to the compiler that particular automatic variables should be allocated to CPU registers, if possible. Thus, register variables provide a certain control over efficiency of program execution. Variables which are used repeatedly or whose access times are critical, may be declared to be of storage class register. Also these register variables are used in huge projects the tiny program developers are not interested to include these register variables, because the tiny programs never requires more time complete its job. These register variables may be used to store constant values so as to make use of it anywhere in the programs. main{ register float a=0;}

User Avatar

Wiki User

βˆ™ 2008-06-04 07:48:26
This answer is:
User Avatar
Study guides

What are advantages of Database Approach

What is a network that covers a large geographical area such as a city country or world

What is the worlds largest wan

What is a network server

See all cards
107 Reviews

Add your answer:

Earn +20 pts
Q: What is register variable in c language?
Write your answer...
Still have questions?
magnify glass
Related questions

Where the variable would be stored in c language?

The Variable will be stored in main memory, if at the time of declaration it is not preceded by any keyword. This is because it will be an auto variable and all the auto variable are stored in main memory. The variable that is stored other than main memory is register variable (stored in register, that is why it is called so.) When you precede a variable by the keyword register, it means you are making a request, it might be or might not stored in the register.

What are register variables in c?

A register specifier for a variable is a compiler hint that the variable is used often and should be kept in a CPU register. The compiler will treat the variable as automatic, but it will give it preference for staying in a register between sequence points.

What is the difference between normal variable and register variable in c?

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.

What is puts in c language?


What is a variable in C language?

variable which is used to specify the values and also we can that values through the variable name

How do you declare a variable in c language?

you have to give a statement in the following syntax datatype variable;

What are c storage classes?

storage classes determines the part of memory where storage is allocated for an object. a scope specifies the part of the program which a variable name is visible, that is accessibility of the variable by its name. in c language there are four storage classes automatic, external, register, static.

What is the size of character variable in 'c' language?

One byte.

What is a constant variables in c language?

It are a variable you add modifer 'const' to. It means these variable mustn't be modified.

What is the variable in c language program?

A variable is the name for a place in the computer's memory where you store some data.

What is count in c language?

count is a function that counts the variable name.

Is β€œC language” case sensitive programminIs β€œC language” case sensitive programming language If yes why and if no whyg language If yes why and if no why?

C is case sensitive, which means that, for example, $var and $VAR are not the same variable.

People also asked