Wednesday 13 March 2013

Global Variable same name 3


#include<stdio.h>
static num;
int main(){
    printf("%d",num);
    return 0;
}
int num =25;

output: 25

Explanation:
Two or more global variables can have same name but we can initialize only one of them.


Blog Author: Vijay Kumar

Go to: Java Aptitude

No comments:

Post a Comment