How do you read input strings in the C language?

In C language, you can use the scanf function to read input strings. Here is a simple example:

#include <stdio.h>

int main() {
    char str[100];
    printf("请输入一个字符串:");
    scanf("%s", str);
    printf("您输入的字符串是:%s\n", str);
    return 0;
}

In the example above, the scanf function uses the %s format specifier to read a string. It will read the input string until it encounters a space, tab, or newline, and then store it in the str array. Make sure that the size of the str array is large enough to hold the input string, which is set to 100 in this case.

bannerAds