Advertisement
dllbridge

Untitled

Dec 9th, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>  
  2.  
  3. int* foo(int v);
  4.  
  5. /////////////////////////////////////////////////////////   printf("%d ,", p[-1]);
  6. int main() {
  7.  
  8.     int  c = 5;
  9.     int* p = foo(c);
  10.  
  11.    
  12.     for (int i = 0; i < 10; i++)
  13.     {
  14.         if (p[i] % 2 != 0)
  15.         {
  16.             printf("%d ,", p[i - c]);
  17.         }
  18.     }
  19.  
  20.  
  21. }
  22.  
  23. ///////////////////////////////////////////////////////
  24. int* foo(int v)
  25. {
  26.     static int mas[10]{ 102,103,125,132,135,144,151,154,159,162 };
  27.    
  28.     return &mas[v];
  29.    
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement