[ create a new paste ] login | about

Link: http://codepad.org/EygspsBF    [ raw code | output | fork ]

C++, pasted on Aug 1:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sstream> // Stringstream-Header
#include <string>
#include <iostream> 

int main()
{
   std::stringstream stream;
   int i = 5;
   double d = 10;
   std::string s = "Ein toller std::string!";
   
   stream << i << std::endl << d << std::endl << s << std::endl;
   std::cout << stream.str() << std::endl;
   std::cout << "C-String: " << stream.str().c_str();
   return 0;
}


Output:
1
2
3
4
5
6
7
5
10
Ein toller std::string!

C-String: 5
10
Ein toller std::string!


Create a new paste based on this one


Comments: