now i am trying to understand pointers and i some what do but can some one explain why this code doesnt work and what would and why ?
it seems to me that i am deleting parr2 wrong if so then how would i go about doing it and how it works ?
First of all let me ask this, why do you need to have a pointer to a pointer? It's kinda redundant. From my understanding, a pointer is simply a variable that literally points to another variable. I may be wrong on that, but whatever xD.
And P.S.: you can use "using namespace std;" after your "#include"s to make it so you don't have to use std::
well what i am trying to do is to makepointer to a pointer behave like a 2 dimensional array
techno there was an error message with your code
and hutch where would the x size and y size of the array go ?
here is my code so far
1. In your solution parr2 points to an array of exactly one element. So referencing (parr2 + 1) and (parr2 + 2) will access unallocated memory.
2. Line 25 will also fail because you've never allocated parr2. It just points to the stack - not to the heap.
xD you are right well was testing all the codes given so i must have missed that sry about that but if lets say i want it to be 5 in hight 3 in width where would i put those values ?? sry for being such an idiot and thx for all the help