|
From: Per W. <pw...@ia...> - 2003-01-18 11:51:43
|
Actually, it's the little guy between the star and the equal (now called Ptr) that have to have a different name than the class name. After new, you HAVE to specify the name of an existing data type, or new wouldn't know what kind of object to allocate. /PerW On Sat, 18 Jan 2003, Zachary Uram wrote: > Hi, > > In your example I think the name you give to new must be different than > class name. > > such as: > > class MyClass; > MyClass* Ptr = new MyClass1; > > Zach > > At 04:16 AM 1/18/03, you wrote: > >umm are we talking about the dynamic memory allocation using pointers and > >the new / delete operators? > > > >class MyClass; // forward declaration > > > >MyClass* Ptr = new MyClass; // Ptr points to an object of type MyClass, > >created dynamically. > > Zachary Uram > John 3:16 > <>< > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: Thawte.com - A 128-bit supercerts will > allow you to extend the highest allowed 128 bit encryption to all your > clients even if they use browsers that are limited to 40 bit encryption. > Get a guide here:http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0030en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |