Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <locale.h> // здесь "живёт" setlocale(LC_ALL, "rus");
- //////////////////////////////
- struct T
- {
- int n;
- T *pNext;
- };
- T t1, t2;
- void monitoe(T *p);
- /////////////////////////////////////////////////////////
- int main()
- {
- T t3, t4;
- t1.n = 5;
- /* printf("t1.n = %d\n", t1.n);
- printf("t2.n = %d\n", t2.n);
- printf("t3.n = %d\n", t3.n);
- printf("t4.n = %d\n", t4.n);
- */
- t1.pNext = &t2;
- t2.pNext = &t3;
- t3.pNext = &t4;
- t4.pNext = 0;
- monitoe(&t1);
- }
- /////////////////////////////////////////////////////////
- void monitoe(T *p)
- {
- while(p->pNext != 0)
- {
- printf("t_.n = %d\n", p->n);
- p = p->pNext;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement