Click here to Skip to main content
15,902,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Why it fails? Pin
David Crow26-Jul-06 3:04
David Crow26-Jul-06 3:04 
GeneralRe: Why it fails? Pin
Zac Howland26-Jul-06 4:21
Zac Howland26-Jul-06 4:21 
GeneralRe: Why it fails? Pin
Saravanan Sundaresan27-Jul-06 2:16
professionalSaravanan Sundaresan27-Jul-06 2:16 
GeneralRe: Why it fails? Pin
David Crow27-Jul-06 3:01
David Crow27-Jul-06 3:01 
GeneralRe: Why it fails? Pin
Zac Howland28-Jul-06 3:51
Zac Howland28-Jul-06 3:51 
QuestionUnmanaged C++, windows service Pin
yoti1126-Jul-06 0:34
yoti1126-Jul-06 0:34 
AnswerRe: Unmanaged C++, windows service Pin
led mike26-Jul-06 5:49
led mike26-Jul-06 5:49 
Questionoverloading an overrided function??? Pin
sawerr26-Jul-06 0:25
sawerr26-Jul-06 0:25 
Hi I know overloading is and i know overriding in virtual functions.But when i overload an overriding functions, something differnet.
<br />
#include <iostream><br />
<br />
using namespace std;<br />
class CBase<br />
{<br />
public:<br />
	virtual void func(char n)<br />
	{<br />
		cout << "base";<br />
	};<br />
	<br />
};<br />
<br />
class CDerived : public CBase<br />
{<br />
public:<br />
	virtual void func(int n)<br />
	{<br />
		cout << " derived";<br />
	}<br />
};<br />
<br />
int main(int argc, char *argv[])<br />
{<br />
	CBase* BaseForDerived = new CDerived;<br />
	double y=123.45;<br />
	int n=100;<br />
	long d= 9;<br />
    BaseForDerived->func(y);<br />
	BaseForDerived->func(n);<br />
	BaseForDerived->func(d);<br />
	CDerived x;<br />
	x.func('c');<br />
	delete BaseForDerived;<br />
}<br />

Here if i write virtual void func(int n) instead of virtual void func(char n) it shows me derived for all.For first 3 it shows me base the last it shows me derived.But i confused.
Does overloading a virtual function ,in derived class mean a new function declariton?
If so why it shows me for x.func('c'); derived but not BASE.

If not why this code shows me for func() base class.I gave int parameter.

I really confused.
I am looking for your answers.
Thanks.
AnswerRe: overloading an overrided function??? Pin
Mike Dimmick26-Jul-06 3:40
Mike Dimmick26-Jul-06 3:40 
AnswerRe: overloading an overrided function??? Pin
Zac Howland26-Jul-06 4:33
Zac Howland26-Jul-06 4:33 
QuestionHow to access function in different classes Pin
jadhav12326-Jul-06 0:22
jadhav12326-Jul-06 0:22 
AnswerRe: How to access function in different classes Pin
see me26-Jul-06 0:29
see me26-Jul-06 0:29 
GeneralRe: How to access function in different classes Pin
jadhav12326-Jul-06 1:09
jadhav12326-Jul-06 1:09 
AnswerRe: How to access function in different classes Pin
Hamid_RT26-Jul-06 1:25
Hamid_RT26-Jul-06 1:25 
GeneralRe: How to access function in different classes Pin
jadhav12326-Jul-06 1:58
jadhav12326-Jul-06 1:58 
GeneralRe: How to access function in different classes Pin
Hamid_RT26-Jul-06 2:30
Hamid_RT26-Jul-06 2:30 
QuestionHow can I add a button on title bar of a window which is create by other process Pin
Hemant kulkarni25-Jul-06 22:40
Hemant kulkarni25-Jul-06 22:40 
AnswerRe: How can I add a button on title bar of a window which is create by other process Pin
NiceNaidu25-Jul-06 23:16
NiceNaidu25-Jul-06 23:16 
AnswerRe: How can I add a button on title bar of a window which is create by other process [modified] Pin
see me25-Jul-06 23:24
see me25-Jul-06 23:24 
Questiondisplay text transparently by DC Pin
includeh1025-Jul-06 22:31
includeh1025-Jul-06 22:31 
AnswerRe: display text transparently by DC Pin
Arman S.25-Jul-06 22:50
Arman S.25-Jul-06 22:50 
GeneralRe: display text transparently by DC Pin
includeh1026-Jul-06 0:30
includeh1026-Jul-06 0:30 
GeneralRe: display text transparently by DC Pin
Hamid_RT26-Jul-06 1:27
Hamid_RT26-Jul-06 1:27 
AnswerRe: display text transparently by DC Pin
Hamid_RT26-Jul-06 1:21
Hamid_RT26-Jul-06 1:21 
QuestionRuntime DLL calling with any parameters Pin
hunter1325-Jul-06 22:27
hunter1325-Jul-06 22:27 

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.