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.
Printable View
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.
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.