Please tell me how to create a multi diminsional array using pointer(dynamic array, set size at run time).
thilinam 0 Light Poster
Recommended Answers
Jump to PostHow to freed allocated memory?
delete []p;
Don't you also have to delete each
p
array? :icon_wink:If you aren't sure, the answer is yes, delete each array first before deleting
p
itself.
Jump to Postline 11 of that code snippet is wrong. It should be delete[], not delete.
Jump to Postpost #3 presents a 1d array as if it were a 2d array. Thats a good way to do it, unless of course the requirement is to create a 2d array.
Jump to PostWhy is contiguous memory even an issue here? Once the array is allocated it doesn't really matter.
All 13 Replies
kvprajapati 1,826 Posting Genius Team Colleague
wildgoose 420 Practically a Posting Shark
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
wildgoose 420 Practically a Posting Shark
kvprajapati 1,826 Posting Genius Team Colleague
daviddoria 334 Posting Virtuoso Featured Poster
u8sand 68 Junior Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
u8sand 68 Junior Poster
siddhant3s 1,429 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
siddhant3s 1,429 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.