Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!orion.cf.uci.edu!bonnie.ics.uci.edu!schmidt From: schmidt@bonnie.ics.uci.edu (Douglas C. Schmidt) Newsgroups: comp.lang.c Subject: Evaluation order of assignment. Message-ID: <957@orion.cf.uci.edu> Date: 16 Aug 88 23:07:11 GMT Sender: news@orion.cf.uci.edu Reply-To: schmidt@bonnie.ics.uci.edu (Douglas C. Schmidt) Distribution: na Organization: University of California, Irvine - Dept. of ICS Lines: 33 Hi, Assume the following recursive type declaration for a linked list: struct list { int item; struct list *next; }; Is the following always guaranteed to produce the "intended" result: ... struct list foo() { struct list head; return(head->next = head = (struct list *) malloc(sizeof(struct list))); } ... My intention is to create a dummy node in a circularly-linked list, and assign the dummy node's next field to point to the head of the list. Since assignment associates from right-to-left this will alway work, right (cryptic style notwithstanding !! ;-)). thanks, Doug Schmidt -- Douglas Schmidt "If our behavior is strict, we do not need fun." -Zippy th' Pinhead "If our behavior is struct, we do not need defun." -Anon