Click here to Skip to main content
15,892,809 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVector C++ Pin
resolvequestion28-Jul-09 12:23
resolvequestion28-Jul-09 12:23 
AnswerRe: Vector C++ Pin
David Crow29-Jul-09 2:53
David Crow29-Jul-09 2:53 
QuestionOverloaded functions - best approach Pin
john john mackey28-Jul-09 11:57
john john mackey28-Jul-09 11:57 
AnswerRe: Overloaded functions - best approach Pin
Rick York28-Jul-09 15:04
mveRick York28-Jul-09 15:04 
AnswerRe: Overloaded functions - best approach Pin
«_Superman_»28-Jul-09 16:37
professional«_Superman_»28-Jul-09 16:37 
GeneralRe: Overloaded functions - best approach Pin
john john mackey29-Jul-09 6:31
john john mackey29-Jul-09 6:31 
AnswerRe: Overloaded functions - best approach Pin
KarstenK28-Jul-09 21:07
mveKarstenK28-Jul-09 21:07 
AnswerRe: Overloaded functions - best approach Pin
Iain Clarke, Warrior Programmer28-Jul-09 23:57
Iain Clarke, Warrior Programmer28-Jul-09 23:57 
Erm, I may be a bit thick...

But to read your post:


john john mackey wrote:
CMyClassA
bool GetAbsTime(SYSTEMTIME *startTime, double hourTime, ClockTime *absTime);
...
CMyClassB
bool GetAbsTime(SYSTEMTIME *realWorldTime, double hourTime, ClockTime *absTime);
...


You have two classes, and they have method that have the same name. So what? I can do the following if I like:
CCorrect
{
public:
    UINT HowCoolIsIain () { return 99; }
};
CWrong {
public:
    UINT HowCoolIsIain () { return 1; }
};

main ()
{
  CCorrect answer1l;
  CWrong answer1l;

  cout << answer1.HowCoolIsIain ();
  cout << answer2.HowCoolIsIain ();
}


This is not operator overloading. I could have called those two functions Alive and Bob, and it would have generated the same machine code. Done the same thing... It can be handy doing this sort of thing - many of my classes have a GetSize () method for how large they'd be if stored on the hard disk, etc.

Iain.

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]

GeneralRe: Overloaded functions - best approach Pin
john john mackey29-Jul-09 6:25
john john mackey29-Jul-09 6:25 
GeneralRe: Overloaded functions - best approach Pin
Rick York29-Jul-09 6:38
mveRick York29-Jul-09 6:38 
QuestionMouse drawing on picture control Pin
kudlaty7928-Jul-09 11:03
kudlaty7928-Jul-09 11:03 
AnswerRe: Mouse drawing on picture control Pin
«_Superman_»28-Jul-09 16:42
professional«_Superman_»28-Jul-09 16:42 
AnswerRe: Mouse drawing on picture control Pin
kudlaty7929-Jul-09 4:26
kudlaty7929-Jul-09 4:26 
GeneralRe: Mouse drawing on picture control Pin
«_Superman_»29-Jul-09 18:26
professional«_Superman_»29-Jul-09 18:26 
Questioncounting the number of output lines Pin
neha_rai28-Jul-09 11:03
neha_rai28-Jul-09 11:03 
QuestionRe: counting the number of output lines Pin
Maximilien28-Jul-09 13:53
Maximilien28-Jul-09 13:53 
AnswerRe: counting the number of output lines Pin
«_Superman_»28-Jul-09 16:46
professional«_Superman_»28-Jul-09 16:46 
QuestionHow to access the registry using c language? Pin
msgreat28-Jul-09 8:58
msgreat28-Jul-09 8:58 
AnswerRe: How to access the registry using c language? Pin
Randor 28-Jul-09 9:48
professional Randor 28-Jul-09 9:48 
GeneralRe: How to access the registry using c language? Pin
msgreat29-Jul-09 3:38
msgreat29-Jul-09 3:38 
GeneralRe: How to access the registry using c language? Pin
Randor 29-Jul-09 4:15
professional Randor 29-Jul-09 4:15 
QuestionCan i find file location by using mouse programming? Pin
WindowsVsLinux28-Jul-09 8:26
WindowsVsLinux28-Jul-09 8:26 
AnswerRe: Can i find file location by using mouse programming? Pin
Maximilien28-Jul-09 8:45
Maximilien28-Jul-09 8:45 
Questioncounterpart in C++ of C#'s UrlEncodeUnicode Pin
manchukuo28-Jul-09 6:25
manchukuo28-Jul-09 6:25 
QuestionRe: counterpart in C++ of C#'s UrlEncodeUnicode Pin
David Crow28-Jul-09 7:16
David Crow28-Jul-09 7:16 

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.