Wednesday 13 March 2013

Different variable scope 3



#include<stdio.h>
int main(){
    struct a{
         int a;
    };
    struct a b={10};
    printf("%d",b.a);
    return 0;
}
output: 10

Explanation: Two variables can have same name in different scope.


Blog Author: Vijay Kumar

Go to: Java Aptitude

No comments:

Post a Comment