Hi,
Suppose I have the following piece of code
My question is
1. Is it valid in C++ to define a variable such as the integer B inside the "if" block?
2. Can we use this integer outside of the "if" block?
Suppose I have the following piece of code
Code:
int main()
{
int A;
//expressions
if
{
int B;
//expressions
}
else
{
//expressions
}
return 0;
}
My question is
1. Is it valid in C++ to define a variable such as the integer B inside the "if" block?
2. Can we use this integer outside of the "if" block?