fork download
  1. #include <iostream>
  2. using namespace std;
  3. class TV;
  4. class Remote
  5. {
  6. private:
  7. int mode;
  8. public:
  9. Remote(int n) : mode(n){}
  10. void set_chan(TV & t, int c);
  11. };
  12. class TV
  13. {
  14. public:
  15. friend void Remote::set_chan(TV & t, int c);
  16. TV(int n) : channel(n){}
  17. private:
  18. int channel;
  19. };
  20. inline void Remote::set_chan(TV & t, int c) { t.channel = c; }
  21.  
  22. int main() {
  23. // your code goes here
  24. return 0;
  25. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty