c++ - Convert vector<char> buf(256) to LPCSTR? -


Is there a way to convert above?

If so, what is the best way?

I think that you can loop through the vector and assign a const char * , but I'm not sure that this is the best way.

  std :: string s (vec.begin (), vec.end ()) ; // now use s.c_str ()  

I think it should be quite safe.


Comments