@m_s__santos/

the-compiler-will-replace-the-name-of-array

C

The compiler will replace the name of the array by a pointer to its first position.

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "stdio.h"

void print_address(int *nums) {
  printf("%p\n", (void*) nums);
}

int main(void) {
  int nums[10];
  
  printf("%p\n", (void*) nums);
  print_address(nums);
  return 0;
}