Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!twwells!bill
From: bill@twwells.com (T. William Wells)
Newsgroups: comp.lang.c
Subject: Re: Struct definition in MS-C
Keywords: pointer, linked list, Microsoft C
Message-ID: <1989Aug18.101819.3634@twwells.com>
Date: 18 Aug 89 10:18:19 GMT
References:  <10761@smoke.BRL.MIL>
Organization: None, Ft. Lauderdale, FL
Lines: 35

In article <10761@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
: In article  shuang@caip.rutgers.edu (Shuang Chen) writes:
: >struct node {
: >     struct node *next;
: >     };
: >as it is with standard C, but this doesn't work with MS-C.

Baloney. It works fine with Microsoft C.

: Actually that should have worked with anybody's C.
: Try something like
:       struct node;
:       struct node {
:               struct node *next;
:       };

Eh? The first example is perfectly good C. The only case I think it
might fail is with something like:

struct node {
	...
};
foo()
{
	struct node {
		struct node *next;
	};

The "struct node *" is, I think, going to refer to the global struct
node, not the local one; in that case, adding an additional "struct
node;" at the start of the function will fix things.

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill@twwells.com