[Qt-interest] Unexpected behaviour for loop
Andreas Pakulat
apaku at gmx.de
Thu May 28 09:43:37 CEST 2009
On 28.05.09 10:28:17, Parker wrote:
> Hello,
> I noticed something strange while using the for loop. Here :
>
> for(int i = 1;i < integerList.size();i++)
> {
>
>
> }
>
>
>
> "i" should be initialized to 1 and we should enter the loop. But it's not happenig. I debuged, the i variable is just not initialized.
How did you test that? And if you don't have a body in your loop, then
your compiler may optimize the whole loop out of your application when
building with optimizations enabled.
Andreas
--
Be cheerful while you are alive.
-- Phathotep, 24th Century B.C.
More information about the Qt-interest-old
mailing list