Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <time.h>
- int foo(int *p);
- ////////////////////////////////////////////
- int main()
- {
- }
- /*
- #include <stdlib.h>
- #include <time.h>
- int foo(int *p);
- ////////////////////////////////////////////
- int main()
- {
- srand(time(0)); // printf("NULL = %d\n", NULL);
- printf("UNIX Time = %d\n", time(0) );
- for(int i = 0; i < 20; i++)
- {
- printf("%d\n", rand());
- }
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int foo(int *p);
- ////////////////////////////////////////////
- int main()
- {
- srand(time(0)); // printf("NULL = %d\n", NULL);
- int arr[10] = {0, 12, 2, 3, 4, 5, 6, 7, 8, 9};
- int *p = arr;
- p = p + 9;
- // arr = arr + 9;
- int n1 = foo(p);// foo(&arr[9]);
- printf(" arr = %d\n", arr);
- return 0;
- }
- ////////////////////////////////////////////////////////
- int foo(int *a)
- {
- printf("*a = %d\n", *a );
- printf(" a = %d\n", a );
- // a = a - 8;
- // printf(" a-8 = %d\n", *a );
- return a[-8];
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int foo(int *p);
- ////////////////////////////////////////////
- int main()
- {
- srand(time(0)); // printf("NULL = %d\n", NULL);
- int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- int n1 = foo(&arr[9]);
- printf(" n1 = %d\n", n1);
- return 0;
- }
- ////////////////////////////////////////////////////////
- int foo(int *a)
- {
- printf("*a = %d\n", *a );
- printf(" a = %d\n", a );
- a = a - 8;
- printf(" a-8 = %d\n", *a );
- // printf("%d", arr[1]);
- return a[0];
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement