Originally Posted by
Magos
If it were a define for struct you'd get warnings inheriting a 'class' from a 'struct'... (have gotten these before
). The keyword appears blue in VC and bold in DevCPP so if not standard it's at least non-official-semi-standard :P
EDIT: ok, __interface seems like the true keyword, interface is a define for __interface. VC only though...
http://msdn.microsoft.com/library/de.../key_f-r_3.asp
so this code
Code:
#define interface struct
interface base
{
virtual void doStuff(void) = 0;
};
class derived : public base
{
public:
virtual void doStuff(void)
{
}
};
won't compile? I'm afraid I call bull......... There are only 2 differences between classes and structs
1: default access (public in struct, private in class)
2: you can't forward declare a struct as a class or vice versa
i.e.
Code:
class MyClass;
// some code
struct MyClass // causes a redefinition error
{
};
but you can certainly inherit one from the other.
as for the interface "keyword", it's an ms-specific extension that's recognised by visual studio. It was originally added in for COM support.