09 2011 档案
摘要:①链表反转单向链表的反转是一个经常被问到的一个面试题,也是一个非常基础的问题。比如一个链表是这样的: 1->2->3->4->5 通过反转后成为5->4->3->2->1。最容易想到的方法遍历一遍链表,利用一个辅助指针,存储遍历过程中当前指针指向的下一个元素,然后将当前节点元素的指针反转后,利用已经存储的指针往后面继续遍历。源代码如下:struct linka { int data; linka* next;};void reverse(linka*& head) { if(head ==NULL) return; linka *pre,
阅读全文
摘要:#include <iostream>#include <string>#include <cstdlib>using namespace std;int main(){ float a = 1.0f; cout << (int)a << endl; cout << (int&)a << endl; cout << boolalpha << ( (int)a == (int&)a ) << endl; // 输出什么? float b = 0.0f; cout
阅读全文
摘要:void ReStart(BOOL bNormal){ PROCESS_INFORMATION info; STARTUPINFO startup; char szPath[128]; char*szCmdLine; GetModuleFileName(AfxGetApp()->m_hInstance,szPath,sizeof(szPath)); szCmdLine=GetCommandLine(); GetStartupInfo(&startup); BOOL bSucc=CreateProc...
阅读全文

浙公网安备 33010602011771号