Date: Fri, 26 Dec 97 15:08:42 PST From: Noam Rotem Subject: RE: Plain C++ question about classes... To: Jimmy Myhrman Cc: djgpp AT delorie DOT com Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk --- On Thu, 25 Dec 1997 23:51:33 +0100 Jimmy Myhrman wrote: >I wonder how I can create an array of an object of a class with a >constructor...hmm, did you understand that ?, look at this code instead: > >CImageBuffer buffer1(320,200); /* creates a 320x200 buffer */ >CImageBuffer buffer_array[100](320,200); /* this thing is BAD */ > >the first line creates a buffer and sends the two arguments for the >constructor, but the second line is illegal, because it's an array. How Do i >write the second line in the right way ????????????????? AFAIK, You can't. Use the default constructor: CImageBuffer buffer_array[100]; Now run a loop to set the initial values... I just hope there is a default constructor for this class. Heap heap array! --------------------------------------------- Noam Rotem John Bryce Training Centre Tel Aviv, Israel. 03-7535803 ============================================= 1. Take upon yourself an impossible mission. 2. Accomplish the mission. 3. Go back to step 1. It's the only sane answer to modern life. --- 26/12/97 15:08:42