Hi, i read many threads about noskipws in stringstream, but i still don't know how to use it. I want to create string with few variables (int, char and string). Sadly, stringstream ends my chain when finds space. Could somebody correct my code?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream>
#include <sstring>
#include <string>
int main(){
stringstream ss;
char * a = "something";
int b = 2;
string c = "test", d;
ss << a << b << c << "const text"; //i don't know how to use noskipws in this line
ss >> d;
cout << d;
}