Saturday, July 16, 2011

What does static void function () means??

what does static void() function means.
it means When you don't want a function to be called from other functions that are defined in other files.

main.c

   main()
   {
     Func1(); //this is not accassble here  since it is static in the funcs.c file

     Func2();//this is accassble here
   }
 

funcs.c

   static void Func1(void); // i am static im not going out side of this class :-)
   void Func2(void);

     
   void Func1(void)
   {
     printf("Func1 called");
   }


   void Func2(void)      
   {
     printf("Func2 called");
   }

No comments:

Post a Comment