Please Help me to Understand the callback functions using this program.Actually i understand the program. But i want to understand it very clear , what is hear happening. So please.....

class Button
{
	public:
	
	class Notifiable
	{
		public:
		
		virtual void notify()=0;
	};
	
	Button (Notifiable *who) : calle (who)
	{
	
	}
	
	void click()
	{
		calle->notify();
	}
	
	private:
	
	notifiable *calle;
};

class CDPlayer
{

	public:
	
	void play()
	{
	   // actions here ...
	}

};

class MyCDPlayer:Public CDPlayer,public Button:Notifiable
{
	public:
	
	void notify()
	{
		play();
	}
};

void main()
{
	MyCDPlayer SONY;
	Button button(&SONY);
	button.Click();
}

Please.....

Recommended Answers

All 4 Replies

....... experts programmers , help me ....

Try describing to us what you think the code does, and we'll check if you're right (or how right you are).

You'll learn more if you think it through and describe what's happening so others can understand rather than simply getting others to do the work for you.

....... experts programmers , help me ....

What are all those dots?

Anyway: Bumping your thread is very impolite. Now I can't speak for all of us, but I personally haven't got a clue what you're asking. You understand the program, but you don't understand the program??

So ask a clear question about what you don't understand.

Member Avatar for jencas

You have a SONY CD-Player and if you click the button it plays. Where is the problem???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.