Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
res = pRecord->Usn ; char sres[1024]; strcpy(sres,""); ltoa(res,sres, 10);
タイプが のこの変数 res がありDWORDLONG、データベースに挿入できるように文字列に変換しようとしています。
DWORDLONG
また、どうすれば元に戻すことができますか。ltoa に相当するものはありますか、それとも自分でロジックを書く必要がありますか?
使用する
boost::lexical_cast<std::string>(res);
また
std::ostringstream o; o << res; o.str();
またはC++ 11で
std::to_string(res);
C++11に戻るには、次を使用します
res=std::stoull(str)
またはC *震え*
char* end; res=strtoull(str.c_str(),&end,10);