char * strncpy(char *pDestination, const char *pSource, size_t count) { char *pSaveDest = pDestination; while (count) { *pDestination = *pSource; if (*pSource == 0) { break; } pDestination++; pSource++; count--; } return pSaveDest; }