Contact Learn C
Copy Program Share Program

Program 194:Printing Character Array using Pointers

Program 194:
 
#include<stdio.h>
main()
{
  int i,max=5;
  char *names[]={"Hello","World","Happy","New","Year"};
  printf("Names are\n");
  for(i=0;i<max;i++)
  {
   printf("%s\n",*(names+i)); //*names(i+1) is same as names[i]

  }
}

Explanation:

//Coming Soon...

Output:

Printing Character Array using Pointers







 

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide