1.19
Copied!
#include <iostream>
#include <strstream>
using namespace std;
int main(){
char iobuf[255];
strstream iostr (iobuf, sizeof iobuf) ;
iostr << "tekshrish \n";
iostr << 100 << hex << ' ' << 100 << ends;
char str[80]; int i ;
iostr.getline(str, 79);
iostr >> dec >> i;
cout << str << ' ' << i << ' ';
iostr >> hex >> i;
cout << hex << i << endl;
system("pause");
return 0;
}
Run on cpp.sh
Copied!