Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define N 100
  5.  
  6. typedef double* pdouble;
  7. typedef int* pint;
  8.  
  9. int main()
  10. {
  11. pdouble pd;
  12. pint pi;
  13.  
  14. if((pd=(pdouble)malloc(sizeof(double)))==NULL) goto mem_err;
  15.  
  16. for(pi=(pint)pd, (*pi)=1; (*pi)<=100; (*pi)++)
  17. {
  18. printf("%d\n", *pi);
  19. }
  20.  
  21. free(pd);
  22.  
  23. return EXIT_SUCCESS;
  24. mem_err:
  25. printf("Memoria insufficiente\n");
  26. return EXIT_FAILURE;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement