Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 12 Online
OpenStudy (anonymous):

what is the work of static in c

OpenStudy (anonymous):

Static is a keyword that hides info from other client programs. i.e., if you include foo.h (that you wrote) in some program baz.c, and in foo.h there is a declaration of static int bar, baz.c can't access bar. Otherwise, it can. I think you can make an allusion to private/public members in a class in C++, but I am unsure.

OpenStudy (anonymous):

static also allows the value of a local variable in a function to be persistent across calls. It's a completely different meaning for the same keyword.

OpenStudy (anonymous):

static generally means the variables data or a function is not available outside the scope of a package.....a global variable is avaialable to any function in a package a private variable is only available to the function or packages scope ......public variable is available to any package so to speak take this with grain of salt depends on your language of choice. :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!