How does the 'register' keyword affect the storage of a variable in a C program?

  • It's allocated in a CPU register
  • It's allocated in the data segment
  • It's allocated in the heap
  • It's allocated in the stack
The 'register' keyword suggests to the compiler to store the variable in a CPU register, which can lead to faster access. However, it's just a hint, and the compiler may choose to ignore it.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *