Advertisement
kekellner

Pasar un puntero a un array

Apr 23rd, 2021
1,072
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                             Online C Compiler.
  4.                 Code, Compile, Run and Debug C program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <stdio.h>
  10. #include <stdint.h>
  11.  
  12. int paco[] = {1, 2, 99, 450, 20};
  13.  
  14. int (*_paco)[5] = &paco;
  15.  
  16. void play_sound(int (*array1)[])
  17. {
  18.     for (int i = 0; i < 5; i++){
  19.         printf("%d", (*array1)[i]);
  20.         printf("\n");
  21.     }
  22.    
  23. }
  24.  
  25. int main()
  26. {
  27.     //printf("Hello World");
  28.    
  29.     play_sound(&paco);
  30.    
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement