daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. void printeaza_pointer(int **cacat){
  6.     for(int i = 0; i < 3; i++){
  7.         for(int j = 0; j < 3; j++){
  8.             printf("%dn",cacat[i][j]);
  9.         }
  10.         putchar('n');
  11.     }
  12. }
  13. int transforma_in0(int **cacat){
  14.     for(int i = 0; i < 3; i++){
  15.         for(int j = 0; j < 3; j++){
  16.             cacat[i][j] = 0;
  17.         }
  18.     }
  19.     return 0;
  20. }
  21. void cheama_transforma0(int (*p)(int **pointer)){
  22.  
  23. }
  24. int main()
  25. {
  26.     int (*p)(int **cacat);
  27.     int **pointer_d = (int **)malloc(sizeof(int*)*3);
  28.     for(int i = 0; i < 3; i++){
  29.         pointer_d[i] = (int *)malloc(sizeof(int)*3);
  30.     }
  31.  
  32.     for(int i = 0; i < 3; i++){
  33.         for(int j = 0; j < 3; j++){
  34.             pointer_d[i][j] = 1;
  35.         }
  36.     }
  37.     p = transforma_in0;
  38.     printeaza_pointer(pointer_d);
  39.     cheama_transforma0(p(pointer_d));
  40.     printeaza_pointer(pointer_d);
  41.  
  42.     return 0;
  43. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top