Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <locale.h>
- int foo(int *arr);
- //////////////////////////////////////////////////////////////
- int main()
- {
- setlocale(LC_ALL, "rus");
- printf("LC_ALL = %d\n", LC_ALL);
- int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- int result = foo(&arr[9]);
- printf("\nСодержимое элемента с индексом 1: %d\n", result);
- return 0;
- }
- /////////////////////////////////////////////////////////////
- int foo(int *arr)
- {
- printf(" arr = %d\n", arr);
- printf("*arr = %d\n", *arr);
- arr--;
- printf("Addres of arr = %d\n", arr);
- printf("*arr = %d\n", arr[-1]);
- return arr[1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement