Monday, 15 June 2015

C++: Converting stringstream to char* runtime error -


I'm trying to convert the string stream of "1.txt" to C ++ so that it's four * values Equals "1.txt". I need raw four * in the form of logic for the function, so it can not explain cells or anything else when I run it, I get an empty output, why I can, and how can I fix it ?

  #define SSTR (x) dynamic_cast & lt; Std :: stringstream & amp; & Gt; ((Std :: stringstream () & lt; std :: dec>  Argc; Std :: string arg; Std :: string arg3; While (streamstream> gt; & gt; arg) argv.push_back (arg); (Auto i = argv.begin (); i! = Argv.end (); i ++) argcpush_back (const_cast & lt; four *> (i-> c_str ()); Arg.push_back (0); Int arg4 = argc.size (); (Int i = 0; i & lt; arg4; i ++) for std :: cout & lt; & Lt; & Amp; Arg3 [i] & lt; & Lt; Std :: endl;  

It looks very complex, instead of an example

 < Code> studs :: ostringstream dew; OSS & LT; & Lt; Bookmanam & lt; & Lt; ".Text"; Std :: string s = oss.str (); Char * pString = New char [s.length () + 1]; Std :: copy (s.c_str (), s.c_str () + s.length () + 1, pString); YourFunctionThatTakesCharPtr (pString); Remove [] pString;  

No comments:

Post a Comment