9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Point
Date: Thu, 15 Aug 2002 13:31:34 -0400	[thread overview]
Message-ID: <0a6e482c90169ec87566e70aec8de0f8@plan9.bell-labs.com> (raw)

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


             reply	other threads:[~2002-08-15 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15 17:31 Russ Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-23 15:59 Sam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a6e482c90169ec87566e70aec8de0f8@plan9.bell-labs.com \
    --to=rsc@plan9.bell-labs.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).