Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Where to start? Pin
Leather992-Nov-05 22:09
Leather992-Nov-05 22:09 
Questionfriend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 4:02
ddmcr2-Nov-05 4:02 
AnswerRe: friend,static,inline,.. recommendation Pin
Maximilien2-Nov-05 4:59
Maximilien2-Nov-05 4:59 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 5:19
ddmcr2-Nov-05 5:19 
GeneralRe: friend,static,inline,.. recommendation Pin
Maximilien2-Nov-05 5:32
Maximilien2-Nov-05 5:32 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 5:42
ddmcr2-Nov-05 5:42 
GeneralRe: friend,static,inline,.. recommendation Pin
toxcct2-Nov-05 5:47
toxcct2-Nov-05 5:47 
AnswerRe: friend,static,inline,.. recommendation [edited] Pin
toxcct2-Nov-05 5:01
toxcct2-Nov-05 5:01 
here is how i would have defined the class...

<font color=blue>class</font> CHugeInteger {
    <font color=green>// for best performances, declare the operators following as inline</font>
  <font color=blue>private</font>:
    CString m_strHugeIntegerValue;        <font color=green>// Value of the integer</font>
    
  <font color=blue>public</font>:
    CHugeInteger();                       <font color=green>// Default constructor</font>
    CHugeInteger(const CString&);         <font color=green>// Constructor from a CString</font>
    CHugeInteger(<font color=blue>int</font>);                    <font color=green>// Constructor from a native integer</font>
    CHugeInteger(<font color=blue>const</font> CHugeInteger&);    <font color=green>// Copy constructor</font>
    ~CHugeInteger();                      <font color=green>// Destructor</font>
    
    <font color=green>// Cast operators for CString <--> CHugeInteger</font>
    CString& <font color=blue>operator</font> CString();
    <font color=blue>friend</font> CHugeInteger& <font color=blue>operator</font> CHugeInteger(<font color=blue>const</font> CString&);
    
    <font color=green>// Inner operations performed on a CHugeInteger</font>
    CHugeInteger& <font color=blue>operator</font> + (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
    CHugeInteger& <font color=blue>operator</font> - (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
    CHugeInteger& <font color=blue>operator</font> * (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
    CHugeInteger& <font color=blue>operator</font> / (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
    CHugeInteger& <font color=blue>operator</font> % (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
    CHugeInteger& <font color=blue>operator</font> ^ (<font color=blue>const</font> CHugeInteger&) <font color=blue>const</font>;
 
    CHugeInteger& <font color=blue>operator</font> = (<font color=blue>const</font> CHugeInteger&);
    CHugeInteger& <font color=blue>operator</font> = (<font color=blue>const</font> CString&);
    CHugeInteger& <font color=blue>operator</font> = (<font color=blue>int</font>);
 };

...but that's just my humble point of view...


TOXCCT >>> GEII power
[toxcct][VisualCalc]

-- modified at 12:30 Wednesday 2nd November, 2005
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 5:24
ddmcr2-Nov-05 5:24 
GeneralRe: friend,static,inline,.. recommendation Pin
toxcct2-Nov-05 5:30
toxcct2-Nov-05 5:30 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 5:47
ddmcr2-Nov-05 5:47 
AnswerRe: friend,static,inline,.. recommendation Pin
S. Senthil Kumar2-Nov-05 5:04
S. Senthil Kumar2-Nov-05 5:04 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 5:17
ddmcr2-Nov-05 5:17 
GeneralRe: friend,static,inline,.. recommendation Pin
David Crow2-Nov-05 6:15
David Crow2-Nov-05 6:15 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 6:44
ddmcr2-Nov-05 6:44 
GeneralRe: friend,static,inline,.. recommendation Pin
toxcct2-Nov-05 6:49
toxcct2-Nov-05 6:49 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 7:12
ddmcr2-Nov-05 7:12 
GeneralRe: friend,static,inline,.. recommendation Pin
toxcct2-Nov-05 20:43
toxcct2-Nov-05 20:43 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 21:28
ddmcr2-Nov-05 21:28 
GeneralRe: friend,static,inline,.. recommendation Pin
Maximilien2-Nov-05 7:08
Maximilien2-Nov-05 7:08 
GeneralRe: friend,static,inline,.. recommendation Pin
ddmcr2-Nov-05 7:24
ddmcr2-Nov-05 7:24 
AnswerRe: friend,static,inline,.. recommendation Pin
David Crow2-Nov-05 6:19
David Crow2-Nov-05 6:19 
AnswerRe: friend,static,inline,.. recommendation Pin
Kythen2-Nov-05 11:44
Kythen2-Nov-05 11:44 
GeneralOT: floating point library Pin
toxcct2-Nov-05 20:56
toxcct2-Nov-05 20:56 
QuestionRe: OT: floating point library Pin
David Crow3-Nov-05 3:49
David Crow3-Nov-05 3:49 

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.