Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct node {
- char entry = 'a'; // valores por defecto
- node *next = nullptr;
- };
- int main()
- {
- node *p0 = new node;
- node *p1 = new node;
- node *p2 = new node;
- p0->next = p1;
- p1->next = p2;
- for (node *p = p0; p != 0; p = p->next)
- cout << p->entry << ' ';
- cout << endl;
- p1->entry = 'b';
- p2->entry = 'c';
- for (node *p = p0; p != 0; p = p->next)
- cout << p->entry << ' ';
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement