14#ifndef OR_TOOLS_BASE_MEMUTIL_H_
15#define OR_TOOLS_BASE_MEMUTIL_H_
21inline char*
memdup(
const char* s,
size_t slen) {
23 if ((copy =
malloc(slen)) ==
nullptr)
return nullptr;
24 memcpy(copy, s, slen);
25 return reinterpret_cast<char*
>(copy);
Convert strings to numbers or numbers to strings.
char * memdup(const char *s, size_t slen)