I am not clear about the life time of global variable and static variable I think both initialize only once and stay alive for life time of program
what is difference between global variable and static variable in the context of life time
Edit : static may be local or global. What is difference between local static and global static variable. I think the difference is only with the scope not in life time