![]() |
|
#1
|
|||
|
|||
a problem with Abstract ClassHi
I am building a paint for my homework and i have a problem with abstract class that i dont understand The error "error C2259: 'CFigure' : cannot instantiate abstract class c:\documents and settings\hung\desktop\paint_h\paint_h\arrays.cpp" here is the code: CPP / C++ / C Code:
Please help i have a date line for the project |
|
#2
|
|||
|
|||
Re: a problem with Abstract ClassQuote:
CPP / C++ / C Code:
The existence of a pure virtual function makes CFigure an abstract class. You cannot create an object of an abstract class type. So when you do the following: CPP / C++ / C Code:
you are attempting to create an array of 100 CFigure objects and the compiler is telling you that it's illegal. Regards, Dave |
|
#3
|
|||
|
|||
Re: a problem with Abstract ClassAny class with pure virtual function is an abstract class.
You can derived a class from abstract class to extend its capabilities and create object from there. __________________
Linux is the best OS in the world. |
|
#4
|
|||
|
|||
Re: a problem with Abstract ClassThanks alot
instead of that i made an array of pointers to the abstract class |
Recent GIDBlog
Toyota - 2008 July Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Return pointer to template's nested class problem | Kimmo | CPP / C++ Forum | 2 | 20-Sep-2007 23:39 |
| A class problem, very confused!! | allenfanwenyuan | CPP / C++ Forum | 2 | 16-Sep-2007 05:13 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 19:23 |
| a tester class and then some. | postage | Java Forum | 1 | 06-May-2006 15:48 |
| calling abstract base class method calls draw instead | achoo | FLTK Forum | 1 | 19-Dec-2004 09:38 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The