Charcter Array size

In the lecture if s1 is printed that sir is initialises with ‘h’,‘e’,‘l’,‘l’,o’ but when it is printed it also has some garbage characters i.e. helloabcde so it has size of 10 bytes but it gives 5 byteson executing.Why??

Hey @Alfred can you tell the time stamp at which you are facing an issue. Watching complete video will take a lot of time

I watched the video and in it, it’s told by bhaiya that abcde is garbage which you also know, but at the time of initialization bhaiya did it like this
char s1={‘h’,‘e’,‘l’,‘l’,‘o’};
So from here size was calculated which is 5 not by ouput from console which show with garbage value.
So from next time keep this in mind that sizeof is calculated independent of the print statement.

Can u tell me any keyboard shortcut to open cb video in full screen

Actually i don’t know if there’s any. You can ask with your peers on whatsapp group as i am not aware of that.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.