Pointer to an array of string in C.

 

01  #include<stdio.h>
02
03 int main()
04 {
05
06 char *IPL[] = {"Chennai Super Kings","Rajasthan Royals","Sunrisers Hyderabad",
07 "Mumbai Indians","Royal Challengers","Kolkata Knight Riders","Kings XI Punjab",
08 "Delhi Daredevils"};
09
10 int i;
11
12 printf( "IPL Teams: nn");
13
14 for( i = 0; i < 8; i++ )
15 printf( ">> %sn", IPL[i]);
16
17 return 0;
18 }
 
 OUTPUT :

IPL Teams:

>> Chennai Super Kings
>> Rajasthan Royals
>> Sunrisers Hyderabad
>> Mumbai Indians
>> Royal Challengers
>> Kolkata Knight Riders
>> Kings XI Punjab
>> Delhi Daredevils

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.