Archived

This topic is now archived and is closed to further replies.

kudi

pointer/array + index

Recommended Posts

I have an array of chars: char* Stream=new char[10]; Now I want to use the fourth element. Do these two examples mean the same: 1: Stream[4]; 2: Pointer=Stream; Pointer+4; Sorry my English, I hope you understand what i mean.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
if you mean, can i access the 4th cell like this, then no. in the second example. it should be *(p+4) = ... The first example is accessing the cell with array notation, and in the second, with pointer notation.

Share this post


Link to post
Share on other sites