Who's the idiot?Originally Posted by elnerdo
This most definately does display the numbers in an array. How exactly doesn't this display the contents of the array? You do know what an array is, right? You should then know that the variable a is in fact an array. You should then also know that "cout<<a[i]" is outputting the contents of the array at that element.Originally Posted by 7stud
Again, who's the idiot?
No it doesn't. It could. But there's nothing guarinteeing that it does in fact only use one variable. Perhaps you should actually look at you code. Here, I'll help, because you seem to be mistaken:Originally Posted by elnerdo
There is absolutely nothing that states that the compiler must optimize that check. Therefore, you do in fact use two variables every single time through your loop. One is the pointer. The other is the variable a.Originally Posted by elnerdo
Again, your compiler might optimize that test. But nothing at all in the C++ language says that will happen. Therefore, by the language itself, you are in fact using two variables every time through the loop.
It's alright to be a smart ass, if you know what you're talking about. Otherwise you just end up looking like a dumbass.