| |
You are here: Experts > Computing/Technology > C/C++ > C++ > Char Pointer
Topic: C++
Expert: Joydeep Bhattacharya
Date: 7/5/2008
Subject: Char Pointer
Question Hello !!
i am initializing the char pointer with 5 names. How will I print it :
char *p[]={"anand","abhi","John","Ana","Geshu"};
I just want to print all the names in different lines using *p.
Please help.
Thanks
Answer Hi Priya
You can do it like this
char *p[]={"anand","abhi","John","Ana","Geshu"};
int i
for(i=0;i<5;i++)
printf("%s",*(p + i));
Do lemme know if you get any problem with the above code.
regards
Joydeep Bhattacharya
http://www.scodz.com
Add to this Answer
Ask a Question
|
|
|
|