Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

c++ struct prob

  • 14-04-2003 08:12PM
    #1
    Registered Users, Registered Users 2 Posts: 2,592 ✭✭✭


    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, Registered Users 2 Posts: 4,119 ✭✭✭deadl0ck


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


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


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


  • Registered Users, Registered Users 2 Posts: 4,119 ✭✭✭deadl0ck


    No Worries !! :D


Advertisement