In c++, any variables declared in main will be available throughout main right? I mean if the variables were declared in a try loop, will they would still be accessible througho
That's normal; each { ... } block mark a new scope, and variables declared inside it are local to it. If you want number to be available throughout all main declare it outside the try block.