Time of Update: 2015-05-30
標籤:AfxGetMainWnd AfxGetMainWnd擷取自身視窗控制代碼 HWND hWnd = AfxGetMainWnd()->m_hWnd; GetTopWindow 函數功能:該函數檢查與特定父視窗相聯的子視窗z序(Z序:垂直螢幕的方向,即疊放次序),並返回在z序頂部的子視窗的控制代碼。 函數原型:HWND GetTopWindow(HWND hWnd); 參數: hWnd:被查序的父視窗的控制代碼。如果該參數為NULL,函數返回Z序頂部的視窗控制代碼。 傳回值:
Time of Update: 2015-05-29
標籤:http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html相信使用過MFC編程的朋友對CString這個類的印象應該非常深刻吧?的確,MFC中的CString類使用起來真的非常的方便好用。但是如果離開了MFC架構,還有沒有這樣使用起來非常方便的類呢?答案是肯定的。也許有人會說,即使不用MFC架構,也可以想辦法使用MFC中的API,具體的操作方法在本文最後給出操作方法。其實,可能很多人很可能會忽略掉標準C++中string類
Time of Update: 2015-05-30
標籤:地址對齊簡單來說就是為了提高訪問記憶體的速度。數組的地址分配比較簡單,由於資料類型相同,地址對齊是一件自然而然的事情。結構體由於存在不同基礎資料型別 (Elementary Data
Time of Update: 2015-05-30
標籤:1 枚舉 1 enum ShapeType 2 { 3 circle, 4 square, 5 rectangle 6 }; 7 8 int main() { 9 10 ShapeType shape = circle;11 12 switch(shape)13 {14 case circle:15 cout<<"ShapeType.circle"<<endl;16
Time of Update: 2015-05-30
標籤:P1.1 選擇問題,選擇出第K大的數,並畫出N為不同值的已耗用時間,K=N/2畢業兩年半,重寫排序,感覺良好。代碼使用冒泡排序,庫函數clock計算大致已耗用時間。 1 // P1_1.cpp : Defines the entry point for the console application. 2 // 3 4 #include "stdafx.h" 5 #include <malloc.h> 6 #include <stdlib.h> 7
Time of Update: 2015-05-30
標籤:簡單類比 c++ 機器人大法好 每日一水 不知道說什麼 Robot MotionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s)
Time of Update: 2015-05-29
標籤:#include <iostream>using namespace std;int gy(int a,int k1){int min;if(a>k1)min=k1;else min=a; while(min) {
Time of Update: 2015-05-30
標籤:#include <iostream>using namespace std;int main(){{int x=1;cout << x << endl;{cout << x << endl;int x=2;cout << x <<endl;{cout << x <<endl;int x=3;cout << x <<endl;}cout << x
Time of Update: 2015-05-28
標籤:補充:1.字串必須要有‘/0‘結束。2.字元數組的長度以字元個數,以‘/0‘做結束標記。3.字串在使用前必須初始化。4.字串求長度函數strlen(m1)5.字串複製函數strcp(m1,m2)6.利用第三個字元數組實現字元相串連 例:char str,str1,str2; printf("str=%s %s",str1,str2);或sprintf(str,"%s %s",str1,str2);7.用fscanf和sprintf函數輸入輸出字元 例:char str[10]={0};
Time of Update: 2015-05-28
標籤:C語言的資料類型C語言程式中使用的各種變數都應預先加以說明,即先說明,後使用。對變數的說明可以包括三個方面:·資料類型·儲存類型·範圍所謂資料類型是按被說明量的性質,表示形式,佔據儲存空間的多少,構造特點來劃分的。在C語言中,資料類型可分為:基礎資料型別 (Elementary Data Type),構造資料類型,指標類型,空類型四大類。 1.基礎資料型別 (Elementary Data Type) 基礎資料型別
Time of Update: 2015-05-29
標籤: 之前對於C/C++的回呼函數不是很理解,今天就來學習下C/C++中的回呼函數。 在理解回呼函數之前,首先討論下函數指標的概念。函數指標:1. 概念:指標是一個變數,是用來指向記憶體位址的。一個程式運行時,所有和運行相關的事物都是需要載入到記憶體中,這就決定了程式運行時的任何物件都可以用指標來指向他。函數是存放在記憶體代碼地區內的,他們同樣有地址,因此同樣可以用指標來存取函數,把這個指向函數入口地址的指標稱為函數指標。2. 先看一個Hello World程式:1 #include
Time of Update: 2015-05-30
標籤:1、代碼如下:class A{public:int _Id;A():_Id(0){printf("A[%d]\n",_Id);}~A(){printf("~A[%d]\n",_Id);}};class B{public:A _A;A* _PA;B(){printf("B\n");}~B(){printf("~B\n");delete _PA;}};int main(int argc, char* argv[]){{B b;b._PA = new A();b._PA->_Id = 17
Time of Update: 2015-05-29
標籤:資料結構 c++ 迴圈隊列 標頭檔:#pragma once#include <iostream>#include <assert.h>using namespace std;template<class Type>class CQueue{public:CQueue(size_t sz = INIT_SZ);~CQueue();public:bool
Time of Update: 2015-05-29
標籤:資料結構 順序棧 括弧匹配 標頭檔:#pragma once#include <iostream>#include <assert.h>#include <string.h>using namespace std;template<class Type>class SeqStack{public:SeqStack(size_t sz =
Time of Update: 2015-05-28
標籤://數組的順序儲存表示//楊鑫#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <time.h>#define OK 1#define ERROR 0#define UNDERFLOW 2#define MAX_ARRAY_DIM 8typedef int Status;typedef int ElemType;typedef struct {
Time of Update: 2015-05-29
標籤:貪吃蛇#include <iostream>#include <stdlib.h>#include <stdio.h>#include <unistd.h>#include <deque>#include <list>#define _SIZE_ 30#define _SET_ cout<<"\033[?25l\033[0m"static int flags = 0;typedef int Array[_
Time of Update: 2015-05-27
標籤:json解析 c++ json解析後的儲存形式:小說明:1.{ "a":1, "b":"a‘ g,f‘d[][{{}{}‘f", "c":["d,ed",2,{"a":1},[1,2],true,null],
Time of Update: 2015-05-27
標籤:c++ 資料結構 迴圈鏈表 標頭檔:#pragma once#include <iostream>using namespace std;template<class Type>class List;// 結點類template<class Type>class NodeList{friend class List<Type>;public:
Time of Update: 2015-05-27
標籤:前言:c++的檔案流處理其實很簡單,前提是你能夠理解它。檔案流本質是利用了一個buffer中介層。有點類似標準輸出和標準輸入一樣。c++ IO的設計保證IO效率,同時又兼顧封裝性和易用性。本文將會講述c++檔案流的用法。有錯誤和疏漏的地方,歡迎批評指證。需要包含的標頭檔: <fstream> 名字空間: std也可以試用<fstream.h>fstream提供了三個類,用來實現c++對檔案的操作。(檔案的建立,讀寫)。 ifstream --
Time of Update: 2015-05-30
標籤: vs20vs2013快速鍵小節:1>:#region#endregion(用來摺疊冗餘代碼)2>:Ctril+K+D快速對其代碼;3>:Ctril+K+C注釋選中代碼