fork download
  1. #include <iostream>
  2. #include <sstream>
  3. using namespace std;
  4.  
  5. void function() {
  6. }
  7.  
  8. int main() {
  9. std::stringstream oss;
  10.  
  11. oss << "Hi Sergei !";
  12.  
  13. std::cout << "Is this the content of my stringstream : " << oss << "?" <<std::endl;
  14.  
  15. oss << (void*)function;
  16. std::cout << "So is this really the address of my function : " << oss << "?" <<std::endl;
  17.  
  18. std::cout << "Or wasn't this the address of my oss, which now contains: " << oss.str()<<endl;
  19.  
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
Is this the content of my stringstream : 0xbf8e7138?
So is this really the address of my function : 0xbf8e7138?
Or wasn't this the address of my oss, which now contains: Hi Sergei !0x8048b90