Top "Stdstring" questions

std::string is the C++ standard library's byte-based "string" type, defined in the <string> header.

MFC: std::string vs CString?

Using C++ with MFC. Coming from a C# background I typically just use string for all, well, strings. I use …

c++ string mfc cstring stdstring
Can a std::string contain embedded nulls?

For regular C strings, a null character '\0' signifies the end of data. What about std::string, can I …

c++ stdstring c-strings null-terminated
Convert vector of uint8 to string

I have a pointer to a vector of type uint8. How would I take this pointer and convert the data …

c++ string stdvector stdstring uint8t
convert string to argv in c++

I have an std::string containing a command to be executed with execv, what is the best "C++" way to …

c++ stdstring argv
Converting QString to std::string

I've seen several other posts about converting QString to std::string, and it should be simple. But somehow I'm getting …

c++ qt stdstring qstring
What is the Linux equivalent of: MultiByteToWideChar & WideCharToMultiByte?

I am working with a class that wraps the std::wstring, this code needs to be cross platform, are there …

c++ windows linux unicode stdstring
How to elegantly initialize vector<char *> with string literal?

The problem comes from an exercise on C++ Primer 5th Edition: Write a program to assign the elements from a …

c++ vector initialization cstring stdstring
What is the point of STL Character Traits?

I notice that in my copy of the SGI STL reference, there is a page about Character Traits but I …

c++ string stl stdstring char-traits
How do I allocate a std::string on the stack using glibc's string implementation?

int main(void) { std::string foo("foo"); } My understanding is that the above code uses the default allocator to call …

c++ memory stack heap stdstring
std::string::iterator to offset and back

Can I set an iterator to position 5 in a string via some member or do I have to do a …

c++ iterator stdstring