Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int liczba = 6;
  7. int *p;
  8. p = &liczba;
  9.  
  10. printf("liczba %d\n", liczba);
  11. printf("\n");
  12. printf("podwojenie liczby\n");
  13. printf("\n");
  14. liczba = liczba + liczba;
  15. printf("wypisanie liczby przez zmienna : %d\n", liczba);
  16. printf("\n");
  17. printf("wypisanie liczby przez wskaznik : %d\n", *p);
  18.  
  19. printf("\n");
  20. printf("przypisanie null do wskaznika\n");
  21.  
  22. free(p);
  23. p = NULL;
  24. if (p != NULL){
  25. printf("zawartosc wskaznika : %d\n",*p);
  26. }
  27. if (p == NULL){
  28. printf("wskaznik jest pusty\n");
  29. }
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement