Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inventory -> linked lists

Status
Not open for further replies.

zanza

Programmer
Feb 18, 2002
89
US
well, a few days after "dynamiclly adding struct members" im back with a half way working linked list. when i go to declare the second structure, it crashes when changing the current pointer to the new structure (line 7 here). just so you know, the W's are there cause its a structure type Weapon

heres the code:

currentW = headW;
while(currentW->next != NULL);
{
currentW = currentW->next;
}
newW = (WEAPON)malloc(sizeof(WEAPON));
currentW->next = newW;
newW->next = NULL;

if you need more, ask me and ill post it, but there are two files associated with this, and their sum of lines is 164. because of that, i uploaded a zipped VC6 workspace to
with humility, i ask that someone who can help would do so. i do realize that im just a pain in the neck for some of you, but this is my first big project and i would like to see it go through. žÅNžÅ
 
Did you ever look at the angband code?
When you can go through that and understand it well
you will be ready to give your project a real try.
Don't let the OO ninnies convince you that C++ is the
"WAY": it isn't.

Finally:
I took a look at your code and my advice is to stick to
basics for now. Find some examples and work through them.
Learn the language first, as you go learn how to debug
your programs and design programs that are easy to maintain and read.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top