首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

面试标题搜集(5)

2013-09-11 
面试题目搜集(5)本博客的《面试题目搜集系列不错》(1)面试题目搜集1(2)面试题目搜集2(3)面试题目搜集3(4)面

面试题目搜集(5)

本博客的《面试题目搜集系列不错》

(1)面试题目搜集1

(2)面试题目搜集2

(3)面试题目搜集3

(4)面试题目搜集4

(5)面试题目搜集5


1.递归打印链表

class CString{public:CString(const char *pStr = NULL){if(pStr == NULL){pData = new char;*pData = '\0';}else{pData = new char[strlen(pStr)+1];assert(pData != NULL);strcpy(pData,pStr);}}CString(const CString& other){pData = new char[strlen(other.pData)];assert(pData != NULL);strcpy(pData,other.pData);}CString& operator=(const CString& other){if(&other == this){CString strTemp(other);char *pTemp = strTemp.pData;strTemp.pData = pData;pData = pTemp;}return *this;}~CString(){if(!pData)delete[] pData;}private:char *pData;};


热点排行