Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/* * Created by SharpDevelop. * User: noo * Date: 2009-8-16 * Time: 21:03 * * 枚舉類型 */using System ;enum enumA:int{ east,//0 south,//1 west,//2
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
首先我們需要知道程式有沒有記憶體泄露,然後定位到底是哪行代碼出現記憶體泄露了,這樣才能將其修複。 最簡單的方法當然是藉助於專業的偵查工具,比較有名如BoundsCheck,功能非常強大,相信做C++開發的人都離不開它。此外就是不使用任何工具,而是自己來實現對記憶體泄露的監控,分如下兩種情況: 一. 在 MFC
Time of Update: 2018-12-07
BOOL 定義 typedef int BOOL; #define FALSE 0 #define TRUE 1 不能完全重載(BOOL的本質就是int),如: //file.h void f(int ); // ok void f(BOOL); // ok // file.cpp void f(int) {/*….*/} // ok void f(BOOL) {/*….*/} //
Time of Update: 2018-12-07
1、 概念 Scott Meyers在《More Effective C++》中舉了個例子,不知你是否還記得?在你還在上學的時候,你的父母要你不要看電視,而去複習功課,於是你把自己關在房間裡,做出一副正在複習功課的樣子,其實你在乾著別的諸如給班上的某位女生寫情書之類的事,而一旦你的父母出來在你房間要檢查你是否在複習時,你才真正撿起課本看書。這就是“拖延戰術”,直到你非要做的時候才去做。 當然,這種事情在現實生活中時往往會出事,但其在編程世界中搖身一變,就成為了最有用的技術,
Time of Update: 2018-12-07
Escape Sequence Represents\aBell (alert)\bBackspace\fFormfeed\nNew line\rCarriage return\tHorizontal tab\vVertical tab\'Single quotation mark\"Double quotation mark\\Backslash\?Literal question mark\oooASCII character in octal notation\xhhASCII
Time of Update: 2018-12-07
在.net中不同視窗之間傳值有很多種不同的方法,這裡給出兩種比較常用的方法: 項目中有兩個表單,Form1和Form2,要實現的效果是點擊Form1中的Button1按鈕實現TextBox1和TextBox2中的值相加,然後把這個相加的值傳遞給Form2中的TextBox1,並在TextBox1中顯示出這個和值。 方法一:通過為表單類寫屬性來傳遞值 (1),在被傳遞值的表單(這裡是Form2)類裡面寫屬性
Time of Update: 2018-12-07
還是看代碼,比較直接,裡面有詳細的描述,應該能看懂。Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
繼續看代碼Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
在結構體與類中的建構函式大致的作用相同,但同時也存在不少的區別,而且這些區別相當重要。 一、先看類中的建構函式Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
自 Visual C++ 6.0 以來 ATL 7.0 和 MFC 7.0 中的重大更改 自 Visual C++ 6.0 以來 ATL 7.0 和 MFC 7.0 中的重大更改 自從 Visual C++ 6.0 以來,已經對 ATL 和 MFC 庫進行了許多改進。這些更改中某些可能會破壞現有的代碼,下面列舉了一些樣本: DLL 不相容性(ATL 和 MFC) ATL 模組類 (ATL) 字串轉換 (ATL) 從 BSTR 轉換到 CString(ATL 和 MFC)
Time of Update: 2018-12-07
在C#程式中想根據某個驗證規則對輸入的內容進行檢測,看是否匹配。我們可以用如下方法。Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-07
在一些大的工程中,可能會包含幾十個基礎類,免不了之間會互相引用 ( 不滿足繼承關係,而是組合關係 ) 。也就是需要互相聲明。好了,這時候會帶來一些混亂。如果處理得不好,會搞得一團糟,根據我的經驗,簡單談談自已的處理辦法:編碼時,我們一般會盡量避免 include 標頭檔,而是採用聲明 class XXX 。 但有時候還是必須用 Include 標頭檔,那麼,兩者的劃分在於什麼呢?應該是很明確的,但書上好像都少有提及。首先:
Time of Update: 2018-12-07
C#訪問同類執行個體的私人成員代碼大家都知道,一個類的私人成員只能在他的內部訪問!但是不知道大家注意到沒有,實際上在C#中一個類的執行個體是可以訪問同一個類的另外一個執行個體的私人成員的。請看這段簡單的代碼public class MyClass { private int i = 0; public void Function() { MyClass a = new MyClass();