From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <0a6e482c90169ec87566e70aec8de0f8@plan9.bell-labs.com> From: "Russ Cox" To: 9fans@cse.psu.edu Subject: Re: [9fans] Point MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Thu, 15 Aug 2002 13:31:34 -0400 Topicbox-Message-UUID: dde299f0-eaca-11e9-9e20-41e7f4b1d025 On Sun Jun 23 12:57:41 EDT 2002 [sic], sah@softcardsystems.com wrote: > > f() { > Point p; > > p = (Point){ 0, 0 }; /* (a) */ > p = Pt(0, 0); /* (b) */ > } > > What's the difference between (a),(b) here? The first is a type constructor, a C extension that Plan 9 added. The second is a function call. The benefit of the first is that you don't need to define the constructor function elsewhere (it's in draw.h, in this case). If you're writing code that has to compile elsewhere, the second is usually the way to go. Russ