How to input an empty string in the C programming language?
In C language, an empty string can be input in two ways.
- Using blank space or line break as the content of a string, for example:
char str[] = " "; // 使用空格符号作为空字符串
char str[] = "\n"; // 使用换行符作为空字符串
- Representing an empty string with an empty character array, for example:
char str[] = ""; // 空的字符数组表示空字符串
An empty string can be represented in any way.