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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remember that inventory question?

Status
Not open for further replies.

zanza

Programmer
Feb 18, 2002
89
US
well, a few days after my post called "dyanmiclly adding struct members" im back a little more learned and perplexed with another problem.

ive got the linked lists working this far: i can create the first member and give it its values. when i went to initialize the second structure, it crashes on
current->next = new;

heres the bit of code that allocates and asigns values for the second struct

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

if you need more code, ive zipped up the project (Visual Studio 6) and posted it here:
the only reason for this is that theres quite a bit of extra code (at least more than would be "cool" to post on a forum) but if you want it anyway, ill go ahead and post it, just lemmie know žÅNžÅ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top