User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 422,951 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,708 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums

Help : Pointers to array of class objects .

Join Date: May 2005
Location: Kolkata
Posts: 41
Reputation: amt_muk is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
amt_muk amt_muk is offline Offline
Light Poster

Re: Help : Pointers to array of class objects .

  #4  
Jun 8th, 2005
Rectangle * ptr_arr;
ptr_arr=new Rectangle[2];
The above code creates an array of 2 Rectangles by calling the constructor:
Rectangle::Rectangle();
But if u want to call the constructor:
Rectangle::Rectangle(int x, int y)
u should use
ptr_arr[0] = new Rectangle(10,20);
ptr_arr[1] = new Rectangle(15,5);
Reply With Quote  
All times are GMT -4. The time now is 2:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC