How to define string in C language

How to define string in C language

In C language (non C++), there is no string type, and the definition of string is implemented using char and wchar type arrays.
The last character of the array is '\0 ', indicating the end of the string.

refe‮r‬ to:lautturi.com
/*
string in C language
*/

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int i = 0;
    char str[] = "Hello World!";
    while(str[i] != '\0')
    {
        printf("%c", str[i]) ; // Print characters one by one
        ++i;
    }
    printf("\n%s", str) ; // Print the string directly
    return 0;
}
Created Time:2017-08-29 11:01:45  Author:lautturi