pointertables and new

Started by
2 comments, last by Atm97fin 20 years, 8 months ago
How did you allocate pointertables with "new" ?
EasyGL - easy to use graphics library.
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.
How do I set my laser printer on stun?
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.
EasyGL - easy to use graphics library.
No problem... look out for those ''deletes'' though, can get a little funny
How do I set my laser printer on stun?

This topic is closed to new replies.

Advertisement