fork(1) download
  1. #include <fstream>
  2. #include <string>
  3.  
  4. //X.h
  5. class X
  6. {
  7. //...
  8. const static std::string fileStr_;
  9. };
  10.  
  11. //X.cpp
  12. //...#include etc...
  13.  
  14. namespace {
  15. std::string makeFileString( const std::string& fileNamePath )
  16. {
  17. return "string";
  18. }
  19. }
  20.  
  21. const std::string X::fileStr_( makeFileString( "MyPath/MyFile.txt" ) );
  22.  
  23. int main()
  24. {
  25. return 0;
  26. }
Success #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty