|
-
November 22nd, 2011, 08:47 PM
#1
Question about char pointer arrays
I have a question regarding to char pointer arrays.
char* S="Just a try!";
char* Array[5];
Array[0]=S;
cout << Array[0];
This code prints the text "Just a try!".Does Array[0] point to the first character J's address in memory or point to the character J?If Array[0] points to the first character J's address in memory,then why don't we use *(Array[0]) instead of just writing Array[0]?When we type cout << Array[0] why doesn't it write the address of Array[0]?
I am a bit confused about pointers like you see.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|