fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class A
  6. {
  7. private:
  8. static std::string s;
  9. public:
  10. void modify_string();
  11. };
  12.  
  13. std::string A::s = "default";
  14.  
  15. void A::modify_string()
  16. {
  17. s = "something"; // Error here.
  18. }
  19.  
  20. int main() {
  21. A a;
  22. a.modify_string();
  23. // your code goes here
  24. return 0;
  25. }
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty