Hi, yesterday i tried this
I am not very good at scope. But from what i understood about scope is it will have a difference scope if the declaration is outside of main.Code:#include <stdio.h> #include <stdlib.h> int main() { int x = 0; if (x ==0) int y = 1; int z = y+x; printf("%d",z); getchar(); return 0; }
However in this case, i am declaring 'y' in the main() function, and why is it still saying that y is not declared in scope?
Thanks