Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!kth.se!cyklop.nada.kth.se!news From: d88-jwa@dront.nada.kth.se (Jon W{tte) Newsgroups: comp.sys.mac.programmer Subject: Re: Think C ?: struct bug Message-ID: <1990Nov18.103920.24295@nada.kth.se> Date: 18 Nov 90 10:39:20 GMT References: <29910@boulder.Colorado.EDU> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 34 In article hairston@henry.ece.cmu.edu (David Hairston) writes: >[bernard@boulder.Colorado.EDU (Bernie Bernstein) writes:] >[] typedef struct { >[] long a; >[] long b; >[] } MY_TYPE; >[] foo(short x) >[] { >[] MY_TYPE id1,id2,id3; >[] >[] id1 = x ? id2 : id3; /* Illegal operation on struct/union */ >my guess is that you've declared id1 to have allocated space and so >you can't change it's address as implied above. i believe you want: > MY_TYPE *id1, id2, id3; > id1 = x ? &id2 : &id3; Well, this is something else. You should be able to assign structs to each other. This should result in a bitwise copy. Like, id1 = id2 ; /* This is BlockMove ( id2 , id1 , sizeof ( id1 ) ) */ > -dave- >hairston@henry.ece.cmu.edu Now, you should know that Think C isn't ANSI C, porting that beast ;-) h+ h+@nada.kth.se "Moof!(tm)"