res = pRecord->Usn ;
    char sres[1024];
    strcpy(sres,"");
    ltoa(res,sres, 10);
I have this variable res, which开发者_运维百科 is of type DWORDLONG, and I am trying to convert it into a string so that I can insert it into the database.
Also, how would I convert it back. Is there a equivalent of ltoa, or do you have to write the logic yourself?
Use
boost::lexical_cast<std::string>(res);
or
std::ostringstream o;
o << res;
o.str();
or in C++11
std::to_string(res);
For going back in C++11 you would use
res=std::stoull(str)
or in C *shiver *
char* end;
res=strtoull(str.c_str(),&end,10);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论