Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL - Newbie... Pin
Joaquín M López Muñoz31-Jan-02 23:41
Joaquín M López Muñoz31-Jan-02 23:41 
GeneralRe: STL - Newbie... Pin
Bernhard31-Jan-02 23:51
Bernhard31-Jan-02 23:51 
GeneralSorry i was in a hurry... Pin
Bernhard31-Jan-02 23:53
Bernhard31-Jan-02 23:53 
GeneralRe: STL - Newbie... Pin
Joaquín M López Muñoz1-Feb-02 3:15
Joaquín M López Muñoz1-Feb-02 3:15 
Generalimport a .DXF file Pin
Gayan31-Jan-02 20:31
Gayan31-Jan-02 20:31 
GeneralRe: import a .DXF file Pin
Jon Hulatt31-Jan-02 23:00
Jon Hulatt31-Jan-02 23:00 
GeneralRe: import a .DXF file Pin
Roger Allen1-Feb-02 3:30
Roger Allen1-Feb-02 3:30 
GeneralOO Design question Pin
Jerome Conus31-Jan-02 19:48
Jerome Conus31-Jan-02 19:48 
Hi !

I'm about to write a little app which will be a RPN Calculator, in order to learn a little bit of C++ and MFCs.

The calculator, as all RPN Calc, will have a stack, and at each position of the stack could be a value. The type of this value could be an integer, a float, or anything I might think of (complex number,...).

I thought that I should have an abstract class (CValue), and derive from this class many specific classes for each possible type. Thus, the stack will just store CValue objects, but, when displaying them, the appropriate method will be called. (I hope a make myself clear !!!)

My question now is : if I want to add two values, but, for example, one is of type CFloat and the other one is CInteger (but both are derived from CValue), how can I do it ? How can I make sure that in this example, the CInteger will be converted to a CFloat, and the result will be a CFloat ? Same problem would occur when, for example, multiplying a CComplex with a CInteger ? How can I make it work, in a good object-oriented way ?

Any help or hint will ne greatly appreciated !

Thanks !

Jerome
GeneralRe: OO Design question Pin
Paul M Watt31-Jan-02 20:11
mentorPaul M Watt31-Jan-02 20:11 
GeneralRe: OO Design question Pin
Bernhard31-Jan-02 20:14
Bernhard31-Jan-02 20:14 
GeneralRe: OO Design question Pin
Joaquín M López Muñoz31-Jan-02 20:20
Joaquín M López Muñoz31-Jan-02 20:20 
GeneralAbout "https://" Pin
wabc31-Jan-02 19:28
wabc31-Jan-02 19:28 
GeneralRe: About "https://" Pin
Kastellanos Nikos1-Feb-02 2:07
Kastellanos Nikos1-Feb-02 2:07 
GeneralRe: About "https://" Pin
lucy1-Feb-02 3:32
lucy1-Feb-02 3:32 
QuestionHow to make an installation package with VC++6 Pin
DengJW31-Jan-02 18:54
DengJW31-Jan-02 18:54 
AnswerRe: How to make an installation package with VC++6 Pin
Mazdak31-Jan-02 19:03
Mazdak31-Jan-02 19:03 
GeneralRe: How to make an installation package with VC++6 Pin
DengJW31-Jan-02 19:57
DengJW31-Jan-02 19:57 
Questioncan I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 18:51
DengJW31-Jan-02 18:51 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 19:18
wangyiming31-Jan-02 19:18 
GeneralRe: can I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 19:34
DengJW31-Jan-02 19:34 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 19:30
wangyiming31-Jan-02 19:30 
GeneralRe: can I write a program to record Windows sytem up/off time? Pin
DengJW31-Jan-02 20:20
DengJW31-Jan-02 20:20 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
wangyiming31-Jan-02 20:16
wangyiming31-Jan-02 20:16 
Generalthen how about shutdown? Pin
DengJW31-Jan-02 20:23
DengJW31-Jan-02 20:23 
AnswerRe: can I write a program to record Windows sytem up/off time? Pin
Jon Sagara31-Jan-02 21:31
Jon Sagara31-Jan-02 21:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.