How many bytes does a 5-character null-terminated string occupy?
A6 bytes
B5 bytes
C4 bytes
D7 bytes
Answer & Solution
Correct answer: A. 6 bytes
Null termination requires an extra byte to store the zero byte marker.
Keep practising String Handling and Wrapper Classes
Browse all String Handling and Wrapper Classes questions for ICSE Class 10, or explore more Computer Applications topics.
Related questions
Match Lewis marks:
1. Marks: p. Symbols
2. Str: q. Initial
3. Rules: r. DeriveMatch Unicode units:
1. Unit: p. Fixed
2. Char: q. Composing
3. UTF8: r. PreferredMatch length types:
1. Fixed: p. Max cap
2. Var: q. Runtime
3. Null: r. Zero byteMatch char scan:
1. Scan: p. In set
2. Verify: q. Not in
3. Match: r. CharMatch immut trade:
1. Thread: p. Safe
2. Copies: q. Costly
3. State: r. SimplerMatch byte encodings:
1. CJK: p. Two bytes
2. EUC: q. ASCII safe
3. Shift: r. UnsafeMatch compare cost:
1. Equals: p. Bool
2. Cmp: q. Int result
3. C-str: r. CostlyMatch sub-strings:
1. Prefix: p. Start
2. Suffix: q. End
3. Factor: r. Slice