I'm learning how arrays are passed to a function and I got confused when the book (C for dummies) said that when you pass an array to a function, the address of the array's first element is what is passed to the function.
I know that an array like char name[]
cannot hold memory address if it is passed to it so I wonder why the function say(char name[])
below can hold the memory address of the array's first element passed to it.
#include <stdio.h>
void say(char name[])
{
printf("Welcome %s",name);
}
int main()
{
char h[] = "Kyle";
say(h);
return(0);
}