Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

pointer/array + index

Started by kudi Oct 2, 2002 at 4:07 PM 1 replies 350+ views
Original Post
kudi
kudi
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.
The problem of Object Oriented Programming:Everybody tells you how to use his classes, but nobody how not to do it !
kuphryn
kuphryn
Your code to advance the pointer is correct. Remember to dereference it to access the content.

Kuphryn

[edited by - kuphryn on October 2, 2002 5:54:33 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.