Search notes:

C++ Standard Library: ostringstream - write formatted text into a char array in memory

ostringstream is to be the C++ replacement for sprintf.
ostringstream is the char specialization of the template class basic_ostringstream (that is, it is: std::basic_ostringstream<char>).
#include <sstream>
#include <iostream>
#include <string>

int main() {

  std::ostringstream oss;

  oss << "Hello, world" << std::endl;
  oss << "42" << std::endl;

  std::string str = oss.str();

  std::cout << str;

}
Github repository about-cpp-standard-library, path: /sstream/ostringstream.cpp

See also

C++ Standard Library

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759331763, '216.73.216.88', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/C-C-plus-plus/CPP-Standard-Library/sstream/ostringstream(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78