Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

c++ struct prob

Options
  • 14-04-2003 8:12pm
    #1
    Registered Users Posts: 2,593 ✭✭✭


    hi all
    i really need help on this one as it for my 3rd year project i trying to read a value from a struct it will read the first value grand then after moving to the next record it just tries to read an invalid memory location

    value = gatelist->Gate->connectorlist->ptr_to_connector->Value;
    // get the value
    InputList *newnode;
    newnode = getInputList();
    newnode->NextInput = NULL;
    newnode->input = value; // creates new node to store the value in
    newnode->NextInput = ValuesList;
    ValuesList->NextInput = newnode;
    // adds it onto the list of values that has already being created
    gatelist->Gate->connectorlist = gatelist->Gate->connectorlist->nextconnectorlist;
    // move to the next node

    if any body can help it would be greatly greatly appreciated
    tanx in advance


Comments

  • Registered Users Posts: 4,185 ✭✭✭deadl0ck


    You'll have to give us the structure definitions and also how you allocated memory for them.


  • Registered Users Posts: 2,593 ✭✭✭tommycahir


    sorry i was just stressing i got it fixed very simple and stupid mistake with the initialisation.. sorry again..


  • Registered Users Posts: 4,185 ✭✭✭deadl0ck


    No Worries !! :D


Advertisement