Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!unhd.unh.edu!jwm712 From: jwm712@unhd.unh.edu (Jonathan W Miner) Newsgroups: comp.lang.c Subject: Re: missing ->= operator Message-ID: <1991Apr30.165110.4165@unhd.unh.edu> Date: 30 Apr 91 16:51:10 GMT References: <9104291641.AA00534@dutiaa.tudelft.nl> Organization: University of New Hampshire Lines: 37 In article <9104291641.AA00534@dutiaa.tudelft.nl> schuller@DUTIAA.TUDELFT.NL (Schuller Schuller Oijen) writes: >Hi all, >recently I've been doing a lot of C pointer programming and I came upon >a missing feature in C. Suppose you have this struct called mygod : > [code deleted] >What you do quite often is : mygodptr = mygodptr->next; >Now C has all these wonderful operators : a += 7, g &= 0xf, etc, etc. >But the ->= operator is missing! You cannot do mygodptr ->= next; ! >All of you who want to fill this gap, please react. Flames to /dev/null. >Bye! Hildo Biersma, schuller@dutiad.tudelft.nl It is my opinion that the +=, &= etc operators were implemented on systems, such as DEC VAX that has two operand instructions. Although it would be nice to have a ->=, it would be a programmer convenience, and it would still be compiled into the same code as p = p->next. Now for my question: how do the below operators compare speedwise? C pseudo VAX code a++; inc a; a += 1; add2 1,a; a = a + 1; add3 1,a,a; Jon. -- Jonathan Miner | I won't speak for UNH, and UNH does not jwm712@unhd.unh.edu | speak for me, but they'll charge me anyway! (603)868-3416 | Hacking to graduate this May! Moving soon to miner@mervax.sanders.com (I think?!)