You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
444 B
27 lines
444 B
4 months ago
|
// Compile this with:
|
||
|
// gcc -g -Wall -fPIC -shared -o libtest24-drop-fns.so test24-drop-fns.cc
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <sstream>
|
||
|
#include <string>
|
||
|
|
||
|
using std::string;
|
||
|
using std::cout;
|
||
|
using std::ostringstream;
|
||
|
using std::ostream;
|
||
|
|
||
|
string
|
||
|
foo(const string& s)
|
||
|
{
|
||
|
string str = "The input string was: '" + s;
|
||
|
return str;
|
||
|
}
|
||
|
|
||
|
ostream*
|
||
|
bar(const string& str)
|
||
|
{
|
||
|
ostringstream *o = new ostringstream;
|
||
|
*o << str << foo(str);
|
||
|
return o;
|
||
|
}
|