A logic that you are in search for is here....computer,softwares, programming,website review,Free download, social life,internet,jobs,job,disease,business,mobile,earn money online,c++,scripting,free software,free,

      



Scope of Variables Declared in for()

The new ANSI C++ standard specifies that variables declared as in for(int i=1; ...) have a scope local to the for statement. Unfortunately, older compilers (like Visual C++ 5.0) use the older concept that the scope is the enclosing group. Below, I list two possible problems arising from this change and their recommended solutions.
Say you want to use the variable after the for() statement. You would have to declare the variable outside of the for() statement.







0 comments:

Post a Comment

Newer Post Home

Free Advertising