The string ends with a white space character \0
in C language
#include <stdio.h> int main(void) { //variable char str[] = "Hello"; int i; //output i = 0; while(str[i] != '\0') { printf("%c\n", str[i]); i++; } printf("End of code\n"); return 0; }
输出
H e l l o End of code