Strange error

Boudewijn Rempt boud at valdyas.org
Tue Jun 28 22:42:58 CEST 2005


On Tue, 28 Jun 2005, Michael Thaler wrote:

>
> outside of the if-statement, it works fine. Does anybody understand this?
> Maybe I am too tired, but the else statement should ensure that tmpRowsMem is
> always declared, shouldn't it? So why does it only work when I move the
> declaration of  tmpRowsMem outside of the if statement?
>

Because it is declared inside the first if block -- which is not
delimited with brackets but one block that as it were is the
same as one statement after the if. If you declare a variable
inside a block, it ceases to be referencable outside the block.

Boudewijn


More information about the kimageshop mailing list