Quote Originally Posted by stober
when you use new or malloc() the memory is normally allocated from the heap. When you allocate an object within a function, it goes on the stack
Code:
void foo()
{
   int x; <<< x is on the stack
  char *ptr = new char[255]; <<< 255 characters are allocated in the heap
                            but ptr object is on the stack 

int array[255]; <<< 255 ints are all on the stack
}
so whats the difrence?