恒生电子笔试题3(4)
时间:2025-03-11
时间:2025-03-11
恒生电子笔试题
int nNum = 0; if (pTree == NULL) { return nNum; } else { struct NODE_LIST** pNew = sub_func(pTree, ppList); int nTemp = 0; if (pTree->pLeft != NULL) { nTemp += func(pTree->pLeft, pNew); if (*pNew == NULL) { return -1; } } if (pTree->pRight != NULL) { nTemp += func(pTree->pRight, pNew); if (*pNew == NULL) { return -1; } } return nTemp + 1; } }
2. 请完成标准C函数:memmove()
void *memmove(void *dest, const void *src, size_t count) {
char *tmp; const char *s;
if (dest == NULL || src == NULL) { return NULL; }
if (dest <= src) { tmp = (char *)dest; s = (const char *)src; while (count--) *tmp++ = *s++; } else { tmp = (char *)dest; tmp += count; s = (const char *)src; s += count;
上一篇:09级电信二班赵晓飞毕业论文