Skip to main content
gamedev.net
🔒 Locked

C++ Interface class?

Started by yuppies 1 reply 350+ views
Original Post
yuppies
yuppies
how to declare an interface class in C++? coz in java we do something like this bellow: java: interface IMyInterface{ public void function1( ); } is there a "interface" equivalent keyword in C++?
mike25025
mike25025
// this is an interfaceclass IFoo{public:	virtual ~IFoo(){};	virtual void bar()=0;};// this is a class that impliments the interfaceclass CBaz : public IFoo{public:	CBaz();	~CBaz();	void bar();};
joanusdmentia
joanusdmentia
There isn't an equivalent keyword, just make all of your functions pure virtual and the result is the same.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The nly verdict is vengeance; a vendett o

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.