#include char* strndup(const char* str, size_t n) { char* newStr = _strdup(str); newStr[n] = 0; return newStr; }