I have this test program and it gives below output.
#include<iostream>
#include<cstdio>
void fun(char arr[])
{
printf(".size of char : %d\n.", sizeof(arr[0]));
printf(".size of char array: %d\n.", sizeof(arr));
}
main()
{
char arr[10]={'a','b','c','d','e'};
fun(arr);
printf("size of char array: %d\n", sizeof(arr));
}
output
.size of char : 1 ..size of char array: 8 .size of char array: 10
Now I understand that in first statement its size of member of array and in third statement is size of entire array but what does 8 in second printf says here?