like int takes 4 bytes how much does string occupy in memory?
How many bytes does string take?like int takes 4 bytes
A char, by definition, takes up one byte.
A string literal is implicitly null-terminated, so it will take up one more byte than the observable number of characters in the literal.