Which operation is not allowed on a variable declared with the register storage class in C?
Correct answer D. Taking its address with the & operator
Explanation
register is only a hint that the variable will be used heavily, but the language rule is strict: you may not apply the unary & operator to it, and a register array cannot be converted to a pointer. Assigning, reading and passing its value are all fine. Modern compilers allocate registers themselves, so the keyword mostly survives in old code.
Answer checked How we write and check questions
Discussion