I think rahul has given a clear solution i.e why the static variable is not accessible in main() function because of its scope. I would like to add one more point in this...that Static variables may be initialized in their declarations;
however, the initializers must be constant expressions, and initialization is done only once at compile time when memory is allocated for the static variable -- ATul Singh | Final Year | Computer Science & Engineering | NIT Jalandhar | 9530739855 | -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.