1 // Compile this with: 2 // gcc -g -Wall -fPIC -shared -o libtest24-drop-fns.so test24-drop-fns.cc 3 4 #include <iostream> 5 #include <sstream> 6 #include <string> 7 8 using std::string; 9 using std::cout; 10 using std::ostringstream; 11 using std::ostream; 12 13 string foo(const string & s)14foo(const string& s) 15 { 16 string str = "The input string was: '" + s; 17 return str; 18 } 19 20 ostream* bar(const string & str)21bar(const string& str) 22 { 23 ostringstream *o = new ostringstream; 24 *o << str << foo(str); 25 return o; 26 } 27