Click here to Skip to main content
15,923,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionneed help for device driver writing Pin
fionashrek032-Jul-06 7:26
fionashrek032-Jul-06 7:26 
AnswerRe: need help for device driver writing Pin
Stephen Hewitt2-Jul-06 13:51
Stephen Hewitt2-Jul-06 13:51 
Questionredirect non-www to www using isapi????? Pin
abdz2-Jul-06 7:17
abdz2-Jul-06 7:17 
Questionset covering problem Pin
maryami2-Jul-06 6:24
maryami2-Jul-06 6:24 
QuestionMethod overloading Pin
Moujan2-Jul-06 6:16
Moujan2-Jul-06 6:16 
AnswerRe: Method overloading Pin
Steve Echols2-Jul-06 6:40
Steve Echols2-Jul-06 6:40 
GeneralRe: Method overloading Pin
Moujan2-Jul-06 7:05
Moujan2-Jul-06 7:05 
GeneralRe: Method overloading Pin
Steve Echols2-Jul-06 7:48
Steve Echols2-Jul-06 7:48 
In my example, I overloaded the SetRect function to accept different types of parameters, but both methods accomplishes the same thing.

So you could use either method, depending on what you need to do.

CRect rc(10, 10, 100, 50);<br />
SetRect(rc);<br />
<br />
- or -<br />
<br />
SetRect(10, 10, 100, 50);


In your example, it is not overloading, since the function names are different (foo1 and foo2)

An example of overloading using your methods would be:

int foo1(int number);<br />
int foo1(float number);<br />


Another note: you CANNOT change the type of the return value.

int foo1(int number);<br />
float foo1(int number);  // INVALID!<br />




- S
50 cups of coffee and you know it's on!
GeneralRe: Method overloading Pin
Moujan2-Jul-06 8:00
Moujan2-Jul-06 8:00 
GeneralRe: Method overloading Pin
Steve Echols2-Jul-06 9:31
Steve Echols2-Jul-06 9:31 
GeneralRe: Method overloading Pin
Michael Dunn2-Jul-06 8:43
sitebuilderMichael Dunn2-Jul-06 8:43 
GeneralRe: Method overloading Pin
Moujan2-Jul-06 8:53
Moujan2-Jul-06 8:53 
GeneralRe: Method overloading Pin
Jun Du2-Jul-06 9:41
Jun Du2-Jul-06 9:41 
QuestionUsing OpenProcess Pin
capricious_0012-Jul-06 1:29
capricious_0012-Jul-06 1:29 
AnswerRe: Using OpenProcess Pin
ovidiucucu2-Jul-06 1:56
ovidiucucu2-Jul-06 1:56 
GeneralRe: Using OpenProcess Pin
capricious_0012-Jul-06 1:59
capricious_0012-Jul-06 1:59 
GeneralRe: Using OpenProcess [modified] Pin
ovidiucucu2-Jul-06 2:17
ovidiucucu2-Jul-06 2:17 
GeneralRe: Using OpenProcess Pin
capricious_0012-Jul-06 4:08
capricious_0012-Jul-06 4:08 
QuestionAssertion faliur when window is min and then max [modified] Pin
Tara142-Jul-06 1:18
Tara142-Jul-06 1:18 
AnswerRe: Assertion faliur when window is min and then max [modified] Pin
ovidiucucu2-Jul-06 2:14
ovidiucucu2-Jul-06 2:14 
GeneralRe: Assertion faliur when window is min and then max Pin
Tara142-Jul-06 2:34
Tara142-Jul-06 2:34 
GeneralRe: Assertion faliur when window is min and then max Pin
ovidiucucu2-Jul-06 21:29
ovidiucucu2-Jul-06 21:29 
GeneralRe: Assertion faliur when window is min and then max Pin
Tara142-Jul-06 21:48
Tara142-Jul-06 21:48 
AnswerRe: Assertion faliur when window is min and then max Pin
Hamid_RT2-Jul-06 19:22
Hamid_RT2-Jul-06 19:22 
QuestionCRichEditCtrl - calculate how many visible lines? Pin
rambuts2-Jul-06 1:11
rambuts2-Jul-06 1:11 

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.