MCARTSHA@UREGINA1.BITNET (Shan Mcarthur) (12/07/89)
Hi. I have been having problems with my lattice 4. I am trying
to initialize a string. The code is as follows:
char
*days[] =
{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
main ()
{
}
It doesn't compile correctly. I get warnings. I have looked in many of my
C manuals and they all say it is perfectly legal. What is happening? Is
there a bug in LC4.01? Or am I missing something?
Shan (reply to mcartsha@uregina1 please)
jms@tardis.Tymnet.COM (Joe Smith) (12/09/89)
In article <8912071519.AA04620@jade.berkeley.edu> MCARTSHA@UREGINA1.BITNET (Shan Mcarthur) writes: char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; main () { } It works fine if compiled exactly as you posted. Of course it fails if days is an auto variable. That is, if the definition is put inside of a function without the "static" keyword. But you showed it defined external to the function, which works with Lattice 4.0. -- Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@gemini.tymnet.com BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms PO Box 49019, MS-D21 | PDP-10 support: My car's license plate is "POPJ P," San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."