anonymous
  • anonymous
I have "list< list > index", a list within a list. I want to access the members of the inside list and call their methods to change their content. How do I do this? As a point of reference for you(no pun intended): typedef list< int > PList; typedef list< list > index; index indexList; PList row;
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
ankit042
  • ankit042
I think you will be using following structures to define your lists |dw:1378047422367:dw|
anonymous
  • anonymous
Yes, that is correct. I understand the structure. My problem is syntax. I do not know how to access the second element of the list to change their content, as opposed to erasing them and inserting a new node. I have two pointers, one of them moves through the second list and the other through the first. The inner-list pointer depends on the outer-list pointer...but when I use the inner-pointer as if it were the an actual node of the second list I get errors of every kind. Could you please help me with the syntax.
ankit042
  • ankit042
let us assume pointer 'p' is head for your inner list. inner list structure { pointer next, int a}; so to access the value you do p->a (C language) to access next element you do p->next If you still face issues please share your code.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
a pointer to a pointer like ankit042 said
anonymous
  • anonymous
How do I change the content of the node? Say the pointer 'p' is the head of my inner list. How do I set its contents equal to "1" say? I am using C++ by the way.
ankit042
  • ankit042
p->a=1;
anonymous
  • anonymous
Updating the inner-list node content goes in the last loop.
anonymous
  • anonymous
The array Primes[] stores the first 10,000 primes starting with two, so Prime[0]=2.
anonymous
  • anonymous
You are right @ankit042, I re-started CodeBlocks because my code wasn't running the compiled changes...afterwards, your suggestion worked just fine. I guess the heap had to be cleaned. Thanks.
ankit042
  • ankit042
Great!

Looking for something else?

Not the answer you are looking for? Search for more explanations.