When I print strlen(str) and sizeof() Here is one char array:
const char *str = "Geeksforgeeks";
When I print strlen(str) and sizeof(str) it gives output as :
cout<<strlen(str)<<endl;
cout<<sizeof(str)<<endl;
output:
strlen(str): 13
sizeof(str): 8
- which should not be the case; sizeof() should return 14 because of extra null character?
- I tried this for smaller strings and sizeof() value doesn't change, still 8 ?