the array of pointers?

is "stack" an array of pointers, and "Type" here i

Page 1 of 1

1 Replies - 724 Views - Last Post: 04 January 2009 - 06:24 AM Rate Topic: -----

#1 sawsan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 02-January 09

the array of pointers?

Post icon  Posted 04 January 2009 - 05:21 AM

private
   Type *stack; 
puplic:
   Stack(int Size)
   {   
   stack=new Type[Size];
   ..}

Is This A Good Question/Topic? 0
  • +

Replies To: the array of pointers?

#2 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 855
  • View blog
  • Posts: 2,338
  • Joined: 20-August 07

Re: the array of pointers?

Posted 04 January 2009 - 06:24 AM

in the example you gave, stack is a pointer variable which is capable of pointing-to 'Type' objects.

the line stack=new Type[Size]; allocates an array of 'Type' objects, and causes stack to point to the first object in that array.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1