fork download
  1. #include <string>
  2. class Foo
  3. {
  4. char const* CString;
  5. public:
  6. void SetString(std::string Data)
  7. {
  8. CString = Data.c_str();
  9. }
  10. };
  11. int main()
  12. {
  13. Foo Bar;
  14. std::string MyStr = "Hello there!";
  15. Bar.SetString(MyStr);
  16. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty