I want to understand when we need to write code like below ? i want to know purpose of it ?
-
can any body explain me below code ?
std::vector<unsigned char> VectorResponseData; VectorResponseData = txnContext->getPrivateData(); // may be json data std::string StrReSponseData(VectorResponseData.begin(),VectorResponseData.end()); -
can any body explain me below code ?
std::vector<unsigned char> VectorResponseData; VectorResponseData = txnContext->getPrivateData(); // may be json data std::string StrReSponseData(VectorResponseData.begin(),VectorResponseData.end());@Qt-embedded-developer
What is there to ask? It gets an array ofunsigned charinto astd::vector, and then builds astd::stringout of all the characters. -
@Qt-embedded-developer
What is there to ask? It gets an array ofunsigned charinto astd::vector, and then builds astd::stringout of all the characters.@JonB i want to know when we need to do this type of conversation in real time ?
is it used for dynamic array data to store into string format ?
-
@JonB i want to know when we need to do this type of conversation in real time ?
is it used for dynamic array data to store into string format ?
@Qt-embedded-developer said in I want to understand when we need to write code like below ? i want to know purpose of it ?:
in real time ?
What should this mean?
is it used for dynamic array data to store into string format ?
No, it copies al elements from VectorResponseData.begin() to VectorResponseData.end() into a std::string as explained in the documentation (7. ctor) ...