Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease Help!!!I'm disperate Pin
Nemok6-Jun-04 10:21
Nemok6-Jun-04 10:21 
GeneralRe: Please Help!!!I'm disperate Pin
FreeLemons6-Jun-04 10:27
FreeLemons6-Jun-04 10:27 
GeneralRe: Please Help!!!I'm disperate Pin
Nemok8-Jun-04 6:06
Nemok8-Jun-04 6:06 
Generalquicksort with random pivot Pin
FreeLemons6-Jun-04 9:40
FreeLemons6-Jun-04 9:40 
GeneralRe: quicksort with random pivot Pin
David Crow7-Jun-04 2:34
David Crow7-Jun-04 2:34 
GeneralThreads dialog box Pin
LasVegasGuy6-Jun-04 8:48
LasVegasGuy6-Jun-04 8:48 
GeneralOverloading -> and ->* operators Pin
Alton Williams6-Jun-04 7:00
Alton Williams6-Jun-04 7:00 
GeneralRe: Overloading -> and ->* operators Pin
Diddy6-Jun-04 11:48
Diddy6-Jun-04 11:48 
Well techincally it would be like this:

class A
{
public:
int m_i;
float *m_pf;

int operator->() const
{
return m_i;
}

float& operator*() const
{
return *m_pf;
}
};

But - while the * operator makes sense, the -> makes none at all. Why would you want a -> operator to return a basic type? (ie not a pointer to a class)

In fact, I belive if you compile the above you will get:

warning C4284: return type for 'A::operator ->' is 'int' (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation)


return type for 'identifier::operator –>' is not a UDT or reference to a UDT. Will produce errors if applied using infix notation

The operator–>( ) function must return either a pointer to a class or an object of or a reference to a class for which operator–>( ) is defined.

The following example causes this warning:

class C
{
public:
int operator->(); // warning
};

It is meaningless to apply the member access operator to fundamental data types that have no member access. This warning message will appear when this happens.


GeneralADO Record Delete issue Pin
brdavid6-Jun-04 2:13
brdavid6-Jun-04 2:13 
GeneralRe: ADO Record Delete issue Pin
Anthony_Yio6-Jun-04 17:21
Anthony_Yio6-Jun-04 17:21 
GeneralRe: ADO Record Delete issue Pin
brdavid7-Jun-04 9:45
brdavid7-Jun-04 9:45 
GeneralCFormView Size control by button click Pin
Sumit Kapoor5-Jun-04 23:54
Sumit Kapoor5-Jun-04 23:54 
GeneralRe: CFormView Size control by button click Pin
valikac6-Jun-04 4:05
valikac6-Jun-04 4:05 
QuestionWhat is wrong with this code Pin
Boniolopez5-Jun-04 23:55
Boniolopez5-Jun-04 23:55 
AnswerRe: What is wrong with this code Pin
valikac6-Jun-04 12:37
valikac6-Jun-04 12:37 
GeneralRe: What is wrong with this code Pin
Boniolopez7-Jun-04 8:29
Boniolopez7-Jun-04 8:29 
Generalskinmagic skinbuilder problem (repost ) Pin
kanetheterrible15-Jun-04 21:54
kanetheterrible15-Jun-04 21:54 
GeneralRe: skinmagic skinbuilder problem (repost ) Pin
Neville Franks5-Jun-04 23:24
Neville Franks5-Jun-04 23:24 
GeneralRe: skinmagic skinbuilder problem (repost ) Pin
Sumit Kapoor6-Jun-04 0:11
Sumit Kapoor6-Jun-04 0:11 
GeneralPassword protecting other apps Pin
Anonymous5-Jun-04 21:34
Anonymous5-Jun-04 21:34 
GeneralRe: Password protecting other apps Pin
kanetheterrible15-Jun-04 21:56
kanetheterrible15-Jun-04 21:56 
GeneralRe: Password protecting other apps Pin
Archer2826-Jun-04 8:08
Archer2826-Jun-04 8:08 
GeneralRe: Password protecting other apps Pin
David Crow7-Jun-04 5:40
David Crow7-Jun-04 5:40 
GeneralRe: Password protecting other apps Pin
Anonymous8-Jun-04 6:34
Anonymous8-Jun-04 6:34 
QuestionWhat is the rwson behind this Pin
Billar5-Jun-04 20:21
Billar5-Jun-04 20:21 

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.