S
sworna vidhya
Hai,
When viewing threads of comp.lang.c, I came across with 'static
const char * const resultFileName = "param.txt";' . Here in this
thread, 'static const char * const resultFileName = "param.txt";' is
declared globally.
a) What is the use of declaring a global variable static?
b) Why in this thread they had use "const" the two times?
c) When mentionting as const, the variable we declared remains
constant. Why there is need for using static?
Kindly clear my doubts.
Thanks and Regards,
M.Sworna Vidhya.
When viewing threads of comp.lang.c, I came across with 'static
const char * const resultFileName = "param.txt";' . Here in this
thread, 'static const char * const resultFileName = "param.txt";' is
declared globally.
a) What is the use of declaring a global variable static?
b) Why in this thread they had use "const" the two times?
c) When mentionting as const, the variable we declared remains
constant. Why there is need for using static?
Kindly clear my doubts.
Thanks and Regards,
M.Sworna Vidhya.