Click here to Skip to main content
15,912,021 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Check existing folder Pin
Blake Miller28-Nov-05 8:30
Blake Miller28-Nov-05 8:30 
QuestionFile Copy Problem!!! Pin
Jagadeesh VN24-Nov-05 1:15
Jagadeesh VN24-Nov-05 1:15 
QuestionHow can I set properties of ActiveX control Pin
zwsonic24-Nov-05 0:20
zwsonic24-Nov-05 0:20 
AnswerRe: How can I set properties of ActiveX control Pin
Jagadeesh VN24-Nov-05 1:38
Jagadeesh VN24-Nov-05 1:38 
GeneralRe: How can I set properties of ActiveX control Pin
zwsonic24-Nov-05 16:21
zwsonic24-Nov-05 16:21 
QuestionHow to avoid flickering? Pin
jayshml23-Nov-05 23:51
jayshml23-Nov-05 23:51 
AnswerRe: How to avoid flickering? Pin
PJ Arends24-Nov-05 16:19
professionalPJ Arends24-Nov-05 16:19 
QuestionVariable Scope Pin
Gizzo23-Nov-05 23:47
Gizzo23-Nov-05 23:47 
Hi everyone!

Revising some code I've found this:

for(int i=0; i<m_aArray.GetSize(); i++)<br />
{<br />
    ...<br />
    if(bCondition)<br />
        break;<br />
}<br />
<br />
if( i==m_aArray.GetSize())<br />
{<br />
    // The condition was not satisfied so do whatever<br />
    ...<br />
}


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?

And just testing I can do things like

for(int i=0; i<5; i++)<br />
{<br />
  ...<br />
}<br />
i = 6;<br />
for(int i=7; i<8; i++)<br />
{<br />
 ...<br />
}


OMG | :OMG: WTF | :WTF:

what is the scope then? D'Oh! | :doh:

Thank you in advance.

Regards.
AnswerRe: Variable Scope Pin
khan++23-Nov-05 23:56
khan++23-Nov-05 23:56 
AnswerRe: Variable Scope Pin
Owner drawn23-Nov-05 23:59
Owner drawn23-Nov-05 23:59 
AnswerRe: Variable Scope Pin
sunit524-Nov-05 18:41
sunit524-Nov-05 18:41 
Questioncode execution Pin
micutzu23-Nov-05 23:25
micutzu23-Nov-05 23:25 
Questionhelp needed from &quot;Albert Hermann's article(Easy to use class for ScreenCapture to printer)&quot; Pin
a_david12323-Nov-05 23:23
a_david12323-Nov-05 23:23 
AnswerRe: help needed from &amp;quot;Albert Hermann's article(Easy to use class for ScreenCapture to printer)&amp;quot; Pin
toxcct23-Nov-05 23:41
toxcct23-Nov-05 23:41 
QuestionMultiple application.exe Pin
Boder Coder23-Nov-05 23:19
Boder Coder23-Nov-05 23:19 
AnswerRe: Multiple application.exe Pin
toxcct23-Nov-05 23:36
toxcct23-Nov-05 23:36 
AnswerRe: Multiple application.exe Pin
micutzu23-Nov-05 23:38
micutzu23-Nov-05 23:38 
GeneralRe: Multiple application.exe Pin
Owner drawn24-Nov-05 0:15
Owner drawn24-Nov-05 0:15 
GeneralRe: Multiple application.exe Pin
Boder Coder24-Nov-05 0:39
Boder Coder24-Nov-05 0:39 
GeneralRe: Multiple application.exe Pin
Rage24-Nov-05 1:22
professionalRage24-Nov-05 1:22 
GeneralRe: Multiple application.exe Pin
Jagadeesh VN24-Nov-05 1:24
Jagadeesh VN24-Nov-05 1:24 
GeneralRe: Multiple application.exe Pin
Boder Coder24-Nov-05 2:24
Boder Coder24-Nov-05 2:24 
GeneralRe: Multiple application.exe Pin
toxcct24-Nov-05 2:42
toxcct24-Nov-05 2:42 
GeneralRe: Multiple application.exe Pin
Boder Coder24-Nov-05 2:55
Boder Coder24-Nov-05 2:55 
GeneralRe: Multiple application.exe Pin
Boder Coder24-Nov-05 2:58
Boder Coder24-Nov-05 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.