Your Ad Here

Monday, March 30, 2009

assignment of pointers to arrays

Hello!
I am so confused about how to assign pointers to char arrays. If we have a charcter string stored in an array as
char s[10]="Name"
then can we define a pointer like char *x; x=s[0]; ?
and will this pointer point to the starting point of the array ?
if in the next statement is
cout<will it print the string name?

If the syntax is not correct, please correct it and kindly explain.

Thanks

Read More...
Your Ad Here

No comments: