fork download
  1. #include <iostream>
  2. using namespace std;
  3. const char *strapp(const char *str, const char *s)
  4. {
  5. string ret="";
  6. ret+=str;
  7. ret+=s;
  8. return ret.c_str();
  9. }
  10. //Note, there is a memory leak in this code
  11. int main() {
  12. cout<<strapp("Hello ","World!")<<endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Hello World!