Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
global Static variables goofed
I have a problem....I am defining a static varialbe in the main c file as global. Now the same variable is defined as extern static in the another file.I use that variable to process some data.Now I check the variable value in the main file after returning from the exiternal file.
As far as i know this should give error while complie....BUT it gets compiled and even runs in a normal fashion as if the variable is a global variable.
here is my code
----------#include #include #include
static int i;
extern int i;