Re: HW8


[ Follow Ups ] [ Post Followup ] [ CS1704 Discussion WWWBoard ] [ FAQ ]

Posted by hussein on July 18, 2000 at 19:54:39:

In Reply to: HW8 posted by Mike on July 18, 2000 at 19:17:07:

: Ok, I got no quams with this. However, in class you also defined a new variable like this (unless I copied wrong):

: NodeType a;
: a = new NodeType;

i probably missed the asterisk ... it should have been "NodeType *a" since it was supposed to be a pointer.

: However, I can't get either to compile. However, this does:
: NodeType* Head = new NodeType;

hmmm ... the book version should have worked since it is essentially the same ...

: I was wondering, can I assume that the above is a Head that points to nothing (not even NULL)?

no. it creates a new node - so you have a linked list with exactly one node.

: Also, is were you find NULL?

it should be in stdlib.h (among other places)



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS1704 Discussion WWWBoard ] [ FAQ ]