fork download
  1. #include <istream>
  2. #include <iostream>
  3. #include <fstream>
  4.  
  5. // .h file
  6. namespace LA {
  7. struct LexicalAnalyzer {
  8. LexicalAnalyzer(std::ifstream&); // ctor declaration
  9. std::ifstream& indata;
  10. };
  11. }
  12.  
  13. //-----------------------------------
  14.  
  15. // .cpp file
  16. LA::LexicalAnalyzer::LexicalAnalyzer(std::ifstream& input) : indata(input)
  17. {
  18. // ctor
  19. }
  20.  
  21. int main() {
  22. std::ifstream in;
  23. LA::LexicalAnalyzer t(in);
  24. }
Success #stdin #stdout 0s 2880KB
stdin
Standard input is empty
stdout
Standard output is empty