English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

5 answers

by declaring a global variable as static you hide it from other files. Its declaration is only visible to the function defined in the same file. other file's functions cannot see this variable.

2006-08-02 23:01:36 · answer #1 · answered by Nikhil G 3 · 0 0

If you would like to use a global constant variable, then static global variable is useful.

2006-08-02 23:03:46 · answer #2 · answered by Indian_Male 4 · 0 0

like a constant you mean? i think its useful when your program uses formulas. there is always a need for constant variables there. when its global, every program code block knows the variable (therefore no initialization and data type declaration needed everytime that variable is called). when its static, it doesn't change (like in pi = 3.1416...). hope this helps.

2006-08-02 23:03:06 · answer #3 · answered by Eric 2 · 0 0

Ria I am sorry I cant go in to any details here but I will give you link for full reference:

C/C++ Programmer's Guide

http://publib.boulder.ibm.com/infocenter/iadthelp/v6r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/cpprog02.htm

2006-08-02 23:04:05 · answer #4 · answered by Joe_Young 6 · 0 0

Exactly. Cheese is too expensive.

2006-08-02 23:00:40 · answer #5 · answered by Opera 3 · 0 0

fedest.com, questions and answers