<<< Pointer as function argument | Index | Arrays of pointers >>> |
Pointers and arrays are closely related. For example,
char* ptr = "hello"; // pointer char arr[] = "hello"; // array
Null character is also included in the array, so sizeof(arr) returns 6:
arr[0] | arr[1] | arr[2] | arr[3] | arr[4] | arr[5] |
H | E | L | L | O | \0 |
<<< Pointer as function argument | Index | Arrays of pointers >>> |