Archived

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

Atm97fin

pointertables and new

Recommended Posts

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