Below I have two variable store in a char array
char one[7] = "130319";
char two[7] = "05A501";
I try to concat them with stringstream
std::ostringstream sz;
sz << one<< two;
After that I convert it to string
std::string stringh = sz.str();
Then I try to merge it to form the path of a file and write text in that file
std::string start="d:/testingwinnet/json/";
std::string end= ".json";
std::string concat= start+stringh + end;
ofstream myfile(concat);
myfile << "test";
myfile.close();
And I am getting the following error
error C2040: 'str' : 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' differs in levels of indirection from 'char *
Any idea. Many thanks