Editing a parameter while creating a sub-class?

S

Steve555

Hi,

I'm creating an object CSub, which is sub-classed from CMaster.

The constructor for either takes a struct as an argument:

CSub:: CSub(BasicModel *inModel : CMaster(inModel)

and this is the struct:

typedef struct{
long size;
long numVertices;
long numTris;
}BasicModel;


What I want to do is edit some inModel parameters for creating a
CSub, before passing it on to the CMaster constructor.

Is there a way to do this?

Thanks

Steve
 
A

amparikh

Hi,

I'm creating an object CSub, which is sub-classed from CMaster.

The constructor for either takes a struct as an argument:

CSub:: CSub(BasicModel *inModel : CMaster(inModel)

and this is the struct:

typedef struct{
long size;
long numVertices;
long numTris;

}BasicModel;

What I want to do is edit some inModel parameters for creating a
CSub, before passing it on to the CMaster constructor.

Is there a way to do this?

Thanks

Steve

This article might help you.

http://www.ddj.com/dept/cpp/184403887
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top