Re: Link lists..
- From: Mark Bluemel <mark_bluemel@xxxxxxxxx>
- Date: Fri, 29 Feb 2008 11:46:38 +0000
johnnash wrote:
i'm declaring a data structure for link list of integers in A.h
#ifndef A_H (can anyone please explain how ifndef works as well..i
just seem to see it in almost every program)
Doesn't your text book or tutorial explain this?
If they don't help, simply Googling for "ifndef" gave me loads of
hits...
The pattern
#ifndef something
#define something
....
....
#endif
is a common technique for handling multiple inclusions of headers.
[snip]
node * head; /*definition, is this sufficient for link list ?, can i
initialize head to NULL here itself */
LL()/* computes the link list */
{
node *p, *prev; /*prev is previous node */
head = NULL;
head->next = NULL;
Bang! you've just tried to dereference a NULL Pointer...
[snip]
What was your actual question?
.
- References:
- Link lists..
- From: johnnash
- Link lists..
- Prev by Date: Re: Freeing memory - will it be available immediately
- Next by Date: Re: Link lists..
- Previous by thread: Link lists..
- Next by thread: Re: Link lists..
- Index(es):
Relevant Pages
|