D
dis_is_eagle
hi...i am new to c programming....please explain me as to why should
an character array be declared as static...thanx...eric
an character array be declared as static...thanx...eric
In what context?hi...i am new to c programming....please explain me as to why should
an character array be declared as static...thanx...eric
hi...i am new to c programming....please explain me as to why should
an character array be declared as static...thanx...eric
hi...i am new to c programming....please explain me as to why should
an character array be declared as static...thanx...eric
In the earlier days, perhaps before C99, a local array could not be
initialized unless it was declared as a static one.
lovecreatesbeauty said:In the earlier days, perhaps before C99, a local array could not be
initialized unless it was declared as a static one.
Ian Collins said:In what context?
The same rules apply for a character array as for any other variable.
If the array is in a compilation unit and you don't want it to be
visible elsewhere, you declare it static to avoid polluting the global
namespace with the array's name.
If the array has function scope and you wish the value to be retained
between calls, you would declare it static.
A static array will auomatically have all elements reset to 0.
Flash said:In C89 you could initialise a local array. I don't know about pre-ANSI
C, but that really was a long time ago.
Yes, perhaps C89 already does it.
P.S. Hi Richard, why are you always in high dudgeon on c.l.c?
Richard said:lovecreatesbeauty said:
I don't suffer fools gladly.
lovecreatesbeauty said:
Have you any evidence to support this refreshingly creative explanation?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.