• Advertisement

Archived

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

pointertables and new

This topic is 5310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
By using pointers to pointers.

For example:

// Array of ten char*

char** myCharPointerPointer = new char*[10];

// Allocate the first char*

myCharPointerPointer[0]= new char[100];

But be aware that pointers to pointers can lead to quite confusing syntax sometimes. I advise you to use brackets whenever possible to know what you''re doing.

Share this post


Link to post
Share on other sites
quote:
Original post by Wildfire
By using pointers to pointers.

For example:

// Array of ten char*

char** myCharPointerPointer = new char*[10];

// Allocate the first char*

myCharPointerPointer[0]= new char[100];

But be aware that pointers to pointers can lead to quite confusing syntax sometimes. I advise you to use brackets whenever possible to know what you''re doing.


Thank you.

Share this post


Link to post
Share on other sites
No problem... look out for those ''deletes'' though, can get a little funny

Share this post


Link to post
Share on other sites

  • Advertisement