Advertisement
dllbridge

Untitled

Dec 6th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1.  
  2.  
  3. #include <stdio.h>  
  4.  
  5. int * foo(int n);
  6.  
  7. int main()
  8. {
  9.  
  10.     int n = 8;
  11.    
  12.     int *p = foo( n);
  13.    
  14.     printf("%d -----,\n", *p);
  15.    
  16.     for (int i = n; i < 10; i++)
  17.     {
  18.         printf("%d ,", p[i-n]);
  19.     }
  20.  
  21. }
  22.  
  23. int * foo(int n)
  24. {
  25.     static int mas[10] = { 100,101,102,103,104,105,106,107,108, 109 };
  26.    
  27. return &mas[n];
  28. }
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement