9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Point
@ 2002-08-15 17:31 Russ Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Russ Cox @ 2002-08-15 17:31 UTC (permalink / raw)
  To: 9fans

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] Point
@ 2002-06-23 15:59 Sam
  0 siblings, 0 replies; 2+ messages in thread
From: Sam @ 2002-06-23 15:59 UTC (permalink / raw)
  To: 9fans


f() {
	Point p;

	p = (Point){ 0, 0 };	/* (a) */
	p = Pt(0, 0);		/* (b) */
}

What's the difference between (a),(b) here?

Cheers,

Sam



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-15 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-15 17:31 [9fans] Point Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-06-23 15:59 Sam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).