fork download
  1. ref class Base
  2. {
  3. public:
  4. virtual void Goo()
  5. {
  6. Show("Base::Goo");
  7. }
  8.  
  9. virtual void Boo()
  10. {
  11. Show("Base::Boo");
  12. }
  13.  
  14. virtual void Doo()
  15. {
  16. Show("Base::Doo");
  17. }
  18. };
  19.  
  20. ref class Derived : Base
  21. {
  22. public:
  23. //Overrides Base::Goo
  24. virtual void Goo()
  25. {
  26. Show("Derived::Goo");
  27. }
  28.  
  29. //Overrides Base::Boo as above
  30. virtual void Boo() = Base::Boo
  31. {
  32. Show("Derived::Boo");
  33. }
  34.  
  35. //Hides Base::Doo
  36. virtual void Doo() new
  37. {
  38. Show("Derived::Doo");
  39. }
  40. };
  41.  
  42. void _tmain()
  43. {
  44. Base^ r = gcnew Derived();
  45. r->Goo();
  46. r->Boo();
  47. r->Doo();
  48. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: error: expected constructor, destructor, or type conversion before ‘class’
stdout
Standard output is empty