Char ch[ ] ={ ‘h’ ,‘e’ ,‘l’ ,‘l’ 'o '};
cout《 ch《sizeof(ch);
output
Size is 5
Ch = helloabcde
Why print helloabcde if abcde is garbage then length of s1 = 10 but it show 5
Character arrays introduction
hello @vishal_sangal_123
sizeof function tell how much memory occupied by ur array in bytes.
since ur array has only 5 elements it is taking 5 bytes.