fork download
  1. //Windows_mgr.h
  2. class Screen;
  3. class window_mgr{
  4. public:
  5. using ScreenIndex = std::vector<Screen>::size_type;
  6. void clear(ScreenIndex);
  7. private:
  8. std::vector<Screen> screens{Screen(24,80,' ')}; // invalid use of incomplete type Screen
  9.  
  10. };
  11.  
  12. #include "Screen.h"
  13. void window_mgr::clear(ScreenIndex i) {
  14. Screen& s = screens[i];
  15. s.contents=std::string(s.height*s.width,' ');
  16. }
  17.  
  18. //Screen.h
  19. class Screen{
  20. public:
  21. typedef std::string::size_type pos;
  22. friend void window_mgr::clear(ScreenIndex);
  23. .
  24. .
  25. .
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:12:10: fatal error: Screen.h: No such file or directory
 #include "Screen.h"
          ^~~~~~~~~~
compilation terminated.
stdout
Standard output is empty