#include <stdio.h>
#include <string.h>
main()
{
char *ptr = "hello world";
char *temp = ptr;
int i;
int len = strlen(ptr);
while(*temp != '\0')
{
printf("%c\n",*temp);
temp++;
}
temp = ptr;
for(i = 0;*(ptr + i) != '\0';i++)
{
printf("%c\n",*(ptr + i)) ;
}
for(i = 0;i < len;i++)
{
printf("%c\n",*(ptr + i)) ;
}
}
#include <string.h>
main()
{
char *ptr = "hello world";
char *temp = ptr;
int i;
int len = strlen(ptr);
while(*temp != '\0')
{
printf("%c\n",*temp);
temp++;
}
temp = ptr;
for(i = 0;*(ptr + i) != '\0';i++)
{
printf("%c\n",*(ptr + i)) ;
}
for(i = 0;i < len;i++)
{
printf("%c\n",*(ptr + i)) ;
}
}