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.
This is a discussion on Register variable within the C Programming forums, part of the General Programming Boards category; can we have interger array as a register variable.I tried that but it shows an error.Is there any way to ...
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.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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.