can we have interger array as a register variable.I tried that but it shows an error.Is there any way to have the array as a register variable.
can we have interger array as a register variable.I tried that but it shows an error.Is there any way to have the array as a register variable.
No you can't.
Using register with a modern compiler is a waste of time. They're perfectly capable of working out what to put in registers and when to do it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Totally agree with Salem. Nearly all compiler (writers) are smarter than you in such cases. If e.g. MSVC sees that a function accesses the integer i nearly 40 times and it's address is never needed, it will likely put that into a register if possible.