What are register variables in C?

Query By: ANKUSH

S

SHIRISH

Variables in C Programming


A variable is a tool to reserve space in a computer's memory. The space is given a name, which is called a variable name for example (i=2;)


  • i is the variable
  • 2 is a constant (Actually, constants are stored in the reserved space)


Register Variable in C


In C programming, register variables are most frequently used in a C program it can be put in registers using the register keyword. It tells the compiler to store the variable in the CPU register instead of memory. Actually, the REGISTER keyword is used to declare the register variables like Scope, Default Value, Lifetime, etc.


Syntax of Register Variable


register data_type var_name = var_value;

0 votes

Your Answer

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

LifeStyle & Fun

© 2024 GDATAMART.COM (All Rights Reserved)