fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. typedef struct wezel {
  4. int liczba;
  5. struct wezel *lewy;
  6. struct wezel *prawy;
  7.  
  8. }* struktura;
  9.  
  10.  
  11. int main() {
  12.  
  13. struct wezel * wsk_pierwszy;
  14.  
  15. struktura pierwsza_liczba = (malloc(sizeof(struct wezel)));
  16. struktura druga_liczba = (malloc(sizeof(struct wezel)));
  17. struktura trzecia_liczba = (malloc(sizeof(struct wezel)));
  18.  
  19.  
  20. wsk_pierwszy = pierwsza_liczba;
  21. pierwsza_liczba->liczba=0;
  22.  
  23.  
  24. druga_liczba->liczba=1;
  25. trzecia_liczba->liczba=2;
  26.  
  27. pierwsza_liczba->lewy = druga_liczba;
  28. pierwsza_liczba->prawy = trzecia_liczba;
  29.  
  30. druga_liczba->lewy = NULL;
  31. druga_liczba->prawy = NULL;
  32.  
  33. trzecia_liczba->lewy = NULL;
  34. trzecia_liczba->prawy = trzecia_liczba;
  35.  
  36.  
  37. return 0;
  38.  
  39.  
  40. }
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
Standard output is empty