User Tools

Site Tools


c_-_c_string_streams:ostrstream

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
c_-_c_string_streams:ostrstream [2017/10/12 11:17] – created peterc_-_c_string_streams:ostrstream [2017/10/12 13:19] (current) – removed peter
Line 1: Line 1:
-====== C - C++ String Streams - ostrstream ====== 
- 
-<code cpp> 
-#include <strstream> 
-#include <iostream> 
-using namespace std; 
-  
-int main() 
-{ 
-  char str[80]; 
-  
-  ostrstream outs(str, sizeof(str)); 
-  
-  outs << "abcdefg "; 
-  outs << 27 << " "  << 890.23; 
-  outs << ends;  // null terminate 
-  
-  cout << outs.pcount(); // display how many chars in outs 
-  
-  cout << " " << str; 
-  
-  return 0; 
-} 
-</code> 
  
c_-_c_string_streams/ostrstream.1507807026.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki