fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int numbers[] = {123,0,0};
  6. // Apparently &array returns pointer to first member
  7. int* first_elm_ptr = &numbers;
  8.  
  9. // So derreferencing address to array reference is same
  10. // as dereferencing array itself
  11. if(*first_elm_ptr == *numbers)
  12. printf("%d == %d\n", *first_elm_ptr, *numbers);
  13. else
  14. printf("%d != %d\n", *first_elm_ptr, *numbers);
  15. // if the first was true than this one also must be true
  16. if(&numbers == numbers) {
  17. printf("Pointer to array is still the same array!\n");
  18. }
  19. else {
  20. printf("Pointer to array is not the same thing as array.\n");
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
123 == 123
Pointer to array is still the same array!