From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: struct...help? Date: Sun, 06 Sep 1998 19:27:07 -0700 Organization: Alcyone Systems Lines: 34 Message-ID: <35F3447B.4576EC37@alcyone.com> References: <3 DOT 0 DOT 5 DOT 16 DOT 19980906220313 DOT 0cf77836 AT mail DOT tir DOT com> NNTP-Posting-Host: kamali.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Thomas J. Hruska wrote: > void FunctionName(void) > { > struct extDate TempDate; > > TempDate = {12, 23, 1993, 0}; > } > > The compiler gives me an error about the expression syntax. What is > going > on? I don't have much documentation on structure initialization. I > want > to initialize the entire structure in one line. In C you can only do this on _initialization_, not general assignment. That is, you can use the structure initialization syntax when the structure is defined, but no time after that. Further, the structure initializers must all be constant. You'll have to write either a function to do it for you, or do it memberwise (initialize each field in the structure). This is a general C question, and thus would have been more appropriate on comp.lang.c. -- Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/ USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE \ / The more violent the love, the more violent the anger. / _Burmese Proverbs_ (tr. Hla Pe)