fork download
  1. class c {
  2. private:
  3. int n[10];
  4. public:
  5. c() {};
  6. ~c() {};
  7. int operator()(int i) { return n[i];};
  8. };
  9.  
  10. class cc {
  11. private:
  12.  
  13. public:
  14. c *mass;
  15. cc() {mass = new c;};
  16. ~cc(){};
  17. c& operator*() const {return *mass;};
  18. };
  19. int main() {
  20. c *c1 = new c();
  21.  
  22. cc * cc1 = new cc();
  23.  
  24. (*(*cc1))(1);
  25. (*cc1)(1);
  26.  
  27.  
  28. delete c1;
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:25: error: no match for call to ‘(cc) (int)’
stdout
Standard output is empty