Click here to Skip to main content
15,898,036 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: migration from c++ 6 to Visual stutio professional 2010 Pin
MagicBishop19-Mar-12 8:24
professionalMagicBishop19-Mar-12 8:24 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 8:26
mrby12319-Mar-12 8:26 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 15:47
mrby12319-Mar-12 15:47 
AnswerRe: migration from c++ 6 to Visual stutio professional 2010 Pin
Albert Holguin19-Mar-12 16:18
professionalAlbert Holguin19-Mar-12 16:18 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 16:26
mrby12319-Mar-12 16:26 
QuestionFunction Overloading Pin
Amrit Agr18-Mar-12 5:46
Amrit Agr18-Mar-12 5:46 
AnswerRe: Function Overloading Pin
jschell18-Mar-12 7:19
jschell18-Mar-12 7:19 
AnswerRe: Function Overloading Pin
smags1319-Mar-12 9:25
smags1319-Mar-12 9:25 
Hi, Amrit,

It's working because it's legal to overload functions based on whether the argument refers to a const or non-const type.

So,
C++
void display(const char*) //pointer pointing to a const type
is overloading
C++
void display(char*) // plain pointer


And you're correct. The following couldn't be overloaded. It won't compile because of const conversion used by compiler. It can't figure out which one is the best match.
C++
void display(char);
void display(const char);
void display(char const);


(Technically, the above are redeclaration. It's fine to just define the third one by adding function body. But it won't compile if all of these three functions have function bodies or definitions.)

By the way, to be clearer, the following won't compiler neither because of the same reason.
C++
void display(char*){...} //plain pointer pointing to a regular type
void display(char* const){...} //const pointer pointing to a regular type

QuestionProblem with drawing using GDI functions... Pin
Rozis18-Mar-12 0:52
Rozis18-Mar-12 0:52 
AnswerRe: Problem with drawing using GDI functions... Pin
Albert Holguin18-Mar-12 17:09
professionalAlbert Holguin18-Mar-12 17:09 
QuestionSecure erase command implementation Pin
K4HVDs18-Mar-12 0:19
K4HVDs18-Mar-12 0:19 
AnswerRe: Secure erase command implementation Pin
jschell18-Mar-12 7:23
jschell18-Mar-12 7:23 
AnswerRe: Secure erase command implementation Pin
Albert Holguin18-Mar-12 17:28
professionalAlbert Holguin18-Mar-12 17:28 
QuestionMultiple threads in MFC Pin
K4HVDs18-Mar-12 0:15
K4HVDs18-Mar-12 0:15 
AnswerRe: Multiple threads in MFC Pin
Jochen Arndt18-Mar-12 1:23
professionalJochen Arndt18-Mar-12 1:23 
AnswerRe: Multiple threads in MFC Pin
Rajesh R Subramanian18-Mar-12 2:47
professionalRajesh R Subramanian18-Mar-12 2:47 
AnswerRe: Multiple threads in MFC Pin
Albert Holguin18-Mar-12 17:13
professionalAlbert Holguin18-Mar-12 17:13 
QuestionLittle advice of CFront Pin
Brandon-X1200017-Mar-12 17:13
Brandon-X1200017-Mar-12 17:13 
AnswerRe: Little advice of CFront Pin
Richard MacCutchan17-Mar-12 22:07
mveRichard MacCutchan17-Mar-12 22:07 
GeneralRe: Little advice of CFront Pin
Brandon-X1200017-Mar-12 23:22
Brandon-X1200017-Mar-12 23:22 
GeneralRe: Little advice of CFront Pin
Richard MacCutchan18-Mar-12 2:14
mveRichard MacCutchan18-Mar-12 2:14 
GeneralRe: Little advice of CFront Pin
Brandon-X1200018-Mar-12 6:39
Brandon-X1200018-Mar-12 6:39 
GeneralRe: Little advice of CFront Pin
Richard MacCutchan18-Mar-12 22:31
mveRichard MacCutchan18-Mar-12 22:31 
GeneralRe: Little advice of CFront Pin
Brandon-X1200020-Mar-12 10:09
Brandon-X1200020-Mar-12 10:09 
AnswerRe: Little advice of CFront Pin
markkuk18-Mar-12 0:08
markkuk18-Mar-12 0:08 

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.