|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 18 ![]() |
Hi,
i am trying to understand generic programming concepts used in OpenFOAM, and have a basic question in C++. suppose I have a "employee" base class which has virtual functions, and two derived classes: Code:
employeeExportA:public employee Code:
employeeExportB:public employee Code:
auto_ptr<employee> myEmployee;
if (inputString == "A")
{
myEmployee = auto_ptr<employeeExportA>(new employeeExportA(4,5));
if (inputString == "B")
{
myEmployee = auto_ptr<employeeExportB>(new employeeExportB(4,5));;
}
|
|
|
|
|
|
|
|
|
#2 | |
|
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 52 ![]() ![]() |
Quote:
|
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|