Home »
Code Examples »
C Code Examples
C - Print each character of string until reach '\0' Code Example
The code for Print each character of string until reach '\0'
#include <stdio.h>
int main(void) {
int i = 0;
char *str = "IncludeHelp!\n";
// Print each character until reach '\0'
while (str[i] != '\0')
printf("%c", str[i++]);
return 0;
}
/*
Output:
IncludeHelp!
*/
Code by IncludeHelp,
on August 12, 2022 08:33