To Copy or to Duplicate a String | C For Dummies Blog

strdup, _mbsdup, _wcsdup - Embarcadero/IDERA strdup makes a duplicate of string s, obtaining space with a call to malloc. The allocated space is (strlen(s) + 1) bytes long. The user is responsible for freeing the space allocated by strdup when it is no longer needed. Return Value strdup Solutions | Experts Exchange - strdup uses malloc and standard C++ allocation uses 'new' - you should use std::string instead of C string functions string s1 = pszAnyString; // get a copy of char array string s2 = s1; // get a second copy using reference counting char buf[1024]; int l = dllFunction(s2.c_str(), buf, sizeof(buf)); // pass a string as a const char pointer strdup threadsafe? Solutions | Experts Exchange

strdup: duplicate a string - Linux Man Pages (3)

STRDUP - cs.colostate.edu

g_strdup_vprintf () gchar * g_strdup_vprintf (const gchar *format, va_list args); Similar to the standard C vsprintf() function but safer, since it calculates the maximum space required and allocates memory to hold the result. The returned string should be freed with g_free() when no longer needed.

strdup, _mbsdup, _wcsdup - Embarcadero/IDERA strdup makes a duplicate of string s, obtaining space with a call to malloc. The allocated space is (strlen(s) + 1) bytes long. The user is responsible for freeing the space allocated by strdup when it is no longer needed. Return Value strdup Solutions | Experts Exchange