Gokulnath007 wrote:
yes. Want to iterate.
Well, a pointer is basically an array (rather, an array is basically a pointer).
A string is an array of characters followed by the null character
'\0'
.
so,
char *str = "hello world";
for (int ch = 0; str[ch] != '\0'; ++ch) {
printf("%c\n", str[ch]);
}