Click here to Skip to main content
15,913,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: 'class' type redefinition error Pin
David Crow24-Mar-04 7:56
David Crow24-Mar-04 7:56 
QuestionC++ Generic Autorun app ? Pin
Marc Piulachs24-Mar-04 4:38
Marc Piulachs24-Mar-04 4:38 
AnswerRe: C++ Generic Autorun app ? Pin
jhwurmbach24-Mar-04 5:34
jhwurmbach24-Mar-04 5:34 
QuestionHow to use CryptExportkey blob Pin
chakra_r24-Mar-04 3:32
chakra_r24-Mar-04 3:32 
General_control87 and signal(SIGFPE....) Pin
prcarp24-Mar-04 3:03
prcarp24-Mar-04 3:03 
GeneralGetDIBits and 98 Problem Pin
Ceri24-Mar-04 2:43
Ceri24-Mar-04 2:43 
GeneralHelp - CPrintDialog as a child Pin
Jason Carter24-Mar-04 2:41
Jason Carter24-Mar-04 2:41 
GeneralOverloading operator [ ] Pin
Imtiaz Murtaza24-Mar-04 0:58
Imtiaz Murtaza24-Mar-04 0:58 
What is the correct method to overload the operator []. I am doing something like:

class MyClass
    {
      
      const int operator[](const int i ) const;
  
      int& operator[](const int i );
      //...
    }


Now i want to invoke the operator [] as follows:

MyClass foo;

    int i = foo[j]; 
    foo[j] = i;     

Strange that in both cases second operator of the above class always gets called. Can anyone tell me whats the problem and why not first operator gets called ??

Imtiaz
GeneralRe: Overloading operator [ ] Pin
Mike Dimmick24-Mar-04 2:20
Mike Dimmick24-Mar-04 2:20 
GeneralRe: Overloading operator [ ] Pin
David Crow24-Mar-04 2:36
David Crow24-Mar-04 2:36 
GeneralRe: Overloading operator [ ] Pin
Ryan Binns24-Mar-04 3:44
Ryan Binns24-Mar-04 3:44 
GeneralSystem performance comparison Pin
Shree24-Mar-04 0:55
Shree24-Mar-04 0:55 
GeneralMFC Views Documents, and Modal windows :_-) Pin
_psh_24-Mar-04 0:41
_psh_24-Mar-04 0:41 
QuestionWhen does it occur the worst case in Quicksort algorithm ? Pin
nguyen_nd24-Mar-04 0:34
nguyen_nd24-Mar-04 0:34 
AnswerRe: When does it occur the worst case in Quicksort algorithm ? Pin
Maximilien24-Mar-04 0:54
Maximilien24-Mar-04 0:54 
AnswerRe: When does it occur the worst case in Quicksort algorithm ? Pin
David Crow24-Mar-04 2:43
David Crow24-Mar-04 2:43 
GeneralEDK Pin
viliam24-Mar-04 0:03
viliam24-Mar-04 0:03 
GeneralRe: EDK Pin
Mike Dimmick24-Mar-04 2:23
Mike Dimmick24-Mar-04 2:23 
GeneralRe: EDK Pin
viliam24-Mar-04 3:44
viliam24-Mar-04 3:44 
GeneralATL Service Tutorial Pin
Anonymous23-Mar-04 23:49
Anonymous23-Mar-04 23:49 
Generalpocket pc Recent Programs Pin
venkigdl23-Mar-04 23:29
venkigdl23-Mar-04 23:29 
GeneralRe: pocket pc Recent Programs Pin
Cedric Moonen23-Mar-04 23:33
Cedric Moonen23-Mar-04 23:33 
QuestionHow to get most significant digit ? Pin
Cedric Moonen23-Mar-04 22:55
Cedric Moonen23-Mar-04 22:55 
AnswerRe: How to get most significant digit ? Pin
Pedro Ruiz23-Mar-04 23:17
Pedro Ruiz23-Mar-04 23:17 
GeneralRe: How to get most significant digit ? Pin
Cedric Moonen23-Mar-04 23:26
Cedric Moonen23-Mar-04 23:26 

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.