printing a string

 #include <stdio.h>


int main(){
char a[]={'A','N','C','H','A','L','\0'};
char b[]="ANAYA";
char *ptr=b;
while(*ptr!='\0')
{
    printf("%c",*ptr);
    ptr++;
}
 return 0;
}

Comments

Popular posts from this blog

snake game Version-2 (using random number)

allocating dynamic memory using calloc

store a table in dynamic array and then change the size of array dynamically to store more numbers