Hi everyone!
Revising some code I've found this:
for(int i=0; i<m_aArray.GetSize(); i++)
{
...
if(bCondition)
break;
}
if( i==m_aArray.GetSize())
{
// The condition was not satisfied so do whatever
...
}
That caused an ASSERT(HowCanItBe) into my brain. If "i" is declared into the
"for", how is possible to use it later? The code compile right, so Was I
wrong thinking that "i" _is_declared_ into the "for"?
Then, talking with the partners at work someone pointed out that in VS you
can do it, but in C++Builder it wouldn't compile.
The question is
What is the standard? And how are declared that kinds of variables?
Thank you in advance.
Regards.