#include <string>#include <iostream> using namespace std; string MyString(){ return string("Hello!");} string UseString(string &s){ return s + " Bye!!!";} int main(){ cout << MyString() << endl; cout << UseString(MyString()) << endl; return 0;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:19: error: invalid initialization of non-const reference of type ‘std::string&’ from a temporary of type ‘std::string’ prog.cpp:11: error: in passing argument 1 of ‘std::string UseString(std::string&)’
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!