From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: struct...help? Date: Mon, 07 Sep 1998 19:24:29 -0300 Organization: NBTel Internet Lines: 24 Message-ID: <35F45D1D.5D2FF629@unb.ca> References: <3 DOT 0 DOT 5 DOT 16 DOT 19980906220313 DOT 0cf77836 AT mail DOT tir DOT com> <35F3447B DOT 4576EC37 AT alcyone DOT com> NNTP-Posting-Host: fctnts05c61.nbnet.nb.ca 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 Erik Max Francis wrote: > 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. That is technically true, but there is a way around that. You can initialize an unnamed instance of the structure and then copy it to yours: struct Mine { int a,b,c; }; Mine a; a = (Mine){4,2,0}; > Further, the structure initializers must all be constant. That is true for ANSI, but not for DJGPP. You can use variables in DJGPP. -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca