Sizeof("abde\0fg")
时间: 2023-09-14 16:07:01 浏览: 62
sizeof 操作符
The size of "abde\0fg" is 8 bytes.
Explanation:
- "abde\0fg" is a string literal with 7 characters (a, b, d, e, \0, f, g).
- The \0 character is the null terminator and indicates the end of the string.
- When using the sizeof operator on a string literal, it includes the null terminator in the size calculation.
- Therefore, the size of "abde\0fg" is 8 bytes (7 characters plus the null terminator).
阅读全文