Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #15114

Re: rms from rosettacode

From Dr Nick <3-nospam@temporary-address.org.uk>
Newsgroups comp.lang.c
Subject Re: rms from rosettacode
Date 2011-12-28 13:41 +0000
Message-ID <87hb0kg6ei.fsf@temporary-address.org.uk> (permalink)
References (1 earlier) <20111227115244.994@kylheku.com> <4efa2b39$0$1383$4fafbaef@reader2.news.tin.it> <jddska$550$1@dont-email.me> <jdf43c$aph$1@dont-email.me> <jdf5sd$kd8$1@dont-email.me>

Show all headers | View raw


"BartC" <bc@freeuk.com> writes:

> "James Kuyper" <jameskuyper@verizon.net> wrote in message
> news:jdf43c$aph$1@dont-email.me...
>> On 12/27/2011 08:49 PM, Eric Sosman wrote:
>
>>> If in two and a half years you have not learned what happens when you
>>> "pass an array" to a function, you have scant aptitude for this
>>> particular discipline.  Other and worthier disciplines exist; go and
>>> pursue one of those.
>>
>> I think you're both being a bit harsh on him. When I saw his comment
>> about being a newcomer, I had the same response - I remembered him being
>> a long-term participant. However, when I searched with Google groups, I
>> also found out he'd been posting here for only 30 months, and I decided
>> not to comment.
>
> I've been posting here a lot longer, but still have problems with some
> things that should be straightforward to a C programmer.
>
> For example, I had trouble the other night with creating a struct with
> self-referential members. I tried loads of combinations including
> forward declarations and got nowhere. I was about to post here, then
> came across this form in some code that was lying around:
>
> typedef struct snode{
> int value;
> int opcode;
> struct snode *aref,*bref;
> } node;
>
> That worked, but how can I turn the 'struct snode*' into a much tidier 'node
> *'? This doesn't work:
>
> typedef struct {
> int value;
> int opcode;
> node *aref,*bref;
> } node;

IIRC:

typedef struct snode snode;
struct snode {
  int value;
  int opcode;
  snode *aref,*bref;
};

those empty struct things (I'm keeping well clear of the
definitions/declarations arguments here) aren't needed very often, but
when they are, they are very useful.
-- 
Online waterways route planner            | http://canalplan.eu
Plan trips, see photos, check facilities  | http://canalplan.org.uk

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-27 11:25 +0100
  Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-27 06:48 -0500
    Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-27 13:01 +0100
      Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-27 07:10 -0500
        Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-27 13:36 +0100
          Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-27 10:04 -0500
    Re: rms from rosettacode Keith Thompson <kst-u@mib.org> - 2011-12-27 14:42 -0800
      Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-27 18:46 -0500
  Re: rms from rosettacode 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-27 09:49 -0800
  Re: rms from rosettacode "BartC" <bc@freeuk.com> - 2011-12-27 18:14 +0000
    Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-27 19:33 +0100
      Re: rms from rosettacode jt@toerring.de (Jens Thoms Toerring) - 2011-12-27 19:04 +0000
        Re: rms from rosettacode Keith Thompson <kst-u@mib.org> - 2011-12-27 14:45 -0800
        Re: rms from rosettacode blp@cs.stanford.edu (Ben Pfaff) - 2011-12-27 14:57 -0800
      Re: rms from rosettacode "BartC" <bc@freeuk.com> - 2011-12-27 19:06 +0000
        Re: rms from rosettacode Bull in a China Blue Shop <chine.bleu@yahoo.com> - 2011-12-27 16:16 -0800
      Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-27 14:11 -0500
      Re: rms from rosettacode Seebs <usenet-nospam@seebs.net> - 2011-12-27 20:13 +0000
      Re: rms from rosettacode Johann Klammer <klammerr@NOSPAM.aon.at> - 2011-12-28 00:23 +0100
      Re: rms from rosettacode 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-27 15:54 -0800
        Re: rms from rosettacode Keith Thompson <kst-u@mib.org> - 2011-12-27 22:53 -0800
          Re: rms from rosettacode Seebs <usenet-nospam@seebs.net> - 2011-12-28 06:29 +0000
          Re: rms from rosettacode 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-28 02:45 -0800
  Re: rms from rosettacode Kaz Kylheku <kaz@kylheku.com> - 2011-12-27 19:53 +0000
    Re: rms from rosettacode Seebs <usenet-nospam@seebs.net> - 2011-12-27 20:13 +0000
    Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-27 21:31 +0100
      Re: rms from rosettacode Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-27 20:49 -0500
        Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-28 11:42 +0100
          Re: rms from rosettacode Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-12-29 08:18 -0800
        Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-28 11:54 +0100
          Re: rms from rosettacode Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-12-29 04:12 +0200
            Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-29 14:38 +0100
        Re: rms from rosettacode Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-12-28 02:26 -0800
          Re: rms from rosettacode Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-12-28 21:35 -0500
            Re: rms from rosettacode superpollo <superpollo@tznvy.pbz> - 2011-12-29 14:10 +0100
        Re: rms from rosettacode James Kuyper <jameskuyper@verizon.net> - 2011-12-28 08:03 -0500
          Re: rms from rosettacode "BartC" <bc@freeuk.com> - 2011-12-28 13:32 +0000
            Re: rms from rosettacode Dr Nick <3-nospam@temporary-address.org.uk> - 2011-12-28 13:41 +0000
            Re: rms from rosettacode Kaz Kylheku <kaz@kylheku.com> - 2011-12-28 19:29 +0000
            Re: rms from rosettacode Keith Thompson <kst-u@mib.org> - 2011-12-28 13:47 -0800
            Re: rms from rosettacode Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-12-29 04:19 +0200
      Re: rms from rosettacode Kaz Kylheku <kaz@kylheku.com> - 2011-12-28 19:11 +0000

csiph-web