Mail Archives: djgpp/1998/09/07/21:28:06
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
- Raw text -