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.
/* 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; }