About FAQ 1.14

I

I wish

http://www.eskimo.com/~scs/C-faq/q1.14.html

It says "there are at least three other equivalently correct
ways of arranging it."

I find two solution

typedef struct node {
char *item;
struct node *next;
} *NODEPTR;

and

typedef struct node *NODEPTR;
struct node {
char *item;
NODEPTR next;
};

What is the remind solution? And which way is better?

--
|
 ___
(-_-)
<¡ä¡ä>¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w¢w ªÅ´ßªª³õ shepjeng.twbbs.org ¢w¢w¢w
¡þ plum.cs.nccu.edu.tw
 
D

dis

http://www.eskimo.com/~scs/C-faq/q1.14.html

It says "there are at least three other equivalently correct
ways of arranging it."

I find two solution

typedef struct node {
char *item;
struct node *next;
} *NODEPTR;

and

typedef struct node *NODEPTR;
struct node {
char *item;
NODEPTR next;
};

What is the remind solution? And which way is better?

A third equivalently correct way of arranging it would be:

typedef struct node *NODEPTR;
struct node {
char *item;
struct node *next;
};

None of these arrangements is technically better than any of the other
arrangements, though I would prefer the arrangement as given in the faq.
 
T

Tristan Miller

Greetings.

Content-Type: text/plain; charset="NETNEWS"

For future postings, please use a standard charset declaration; doing
otherwise can inconvenience others trying to read your posts, or in the
worst case, prevent them from showing up at all. "us-ascii" should be
sufficient for most posts to comp.lang.c.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top