fork(32) download
  1. #include <stdio.h>
  2.  
  3. void func1(int dynArray[]) {
  4. printf("func1: dynArray = %p, &dynArray[0] = %p, dynArray[0] = %d\n", dynArray, &dynArray[0], dynArray[0]);
  5. }
  6.  
  7. void func2(int* intPtr) {
  8. printf("func2: intPtr = %p, &intPtr[0] = %p, intPtr[0] = %d\n", intPtr, &intPtr[0], intPtr[0]);
  9. }
  10.  
  11. void func3(int intVal) {
  12. printf("func3: intVal = %d, &intValue = %p\n", intVal, &intVal);
  13. }
  14.  
  15. int main() {
  16. int mainArray[3] = { 1, 2, 3 };
  17. int mainInt = 10;
  18.  
  19. printf("mainArray = %p, &mainArray[0] = %p, mainArray[0] = %d\n", mainArray, &mainArray, mainArray[0]);
  20. func1(mainArray);
  21. func2(mainArray);
  22. printf("mainInt = %d, &mainInt = %p\n", mainInt, &mainInt);
  23. func3(mainInt);
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
mainArray = 0xbf806ad4, &mainArray[0] = 0xbf806ad4, mainArray[0] = 1
func1: dynArray = 0xbf806ad4, &dynArray[0] = 0xbf806ad4, dynArray[0] = 1
func2: intPtr = 0xbf806ad4, &intPtr[0] = 0xbf806ad4, intPtr[0] = 1
mainInt = 10, &mainInt = 0xbf806acc
func3: intVal = 10, &intValue = 0xbf806ad0