瀏覽人數  最新更新日期2007/06/19

 Learning By Explain & Example

1.          英文字母轉換
       
如果有一個英文字母為大寫(Uppercase),要將它轉成為小寫(Lowercase)的話要如何轉換呢?...

2.          限制輸入
       
輸入與輸出是程式中最常用也是最重要的一部份,但在某些情況下,限制使用者輸入資料是有必要的...

3.          四捨五入
       
假設一個數字10.6,要怎麼讓電腦知道四捨五入呢?...

4.          資料交換
       
資料的交換在處理資料上很常使用,也是在初學程式設計上會碰到的問題...

5.          建構子( ~ )    -    建構子是什麼呢?建構子是從什麼樣的觀念演化過來的呢?...
        1)    建構子()
        2)    建構子()
        3)    建構子()

6.          清除Console畫面      
       
Visual C++Borland C++Turbo C++編譯器中,如何寫出能清除Console畫面的指令...

7.          C語言輸入緩衝區
       
輸入緩衝區(Input buffer)是用來放置使用者輸入的資料,並由一個pointer來控制read/write的位置...   

8.          C++ 輸入串流
       
何謂串流呢?。當資料被輸入時,先放置到輸入串流(Input Stream),並由get pointer來控制下一個接收資料的位置,...

9.          C++ 輸出串流( ~ )       
       
先來看看ostream << 有的項目,查至標題檔ostream.h...
        1)    C++輸出串流()
        2)    C++輸出串流()
        3)    C++輸出串流()
        4)    C++輸出串流()

10.      變數的記憶體型態
       
在程式中依照變數的宣告所在,可分為全域變數(global variable)及區域變數(local variable)...

11.      指標語法剖析  
       
學習如何閱讀指標語法的順序...

12.      Side Effects
       
在同一個expression中,物件被修改的次數多達一次以上,在語言中沒有定義。...

13.      Compile-time
       
什麼是compiler呢?compiler主要的目的是將computer language轉換成另一種computer language...   

14.      Zero-initialize
        zero-initialize(0做初始化)並不是在宣告時必做的事情,可以使用有意義的值去初始化物件...

15.      Comma ","                   
       
comma expression中,comma被視為一個運算字(operator)...

16.      列舉(enumeration) 
        1)    列舉()
               
enum (enumerator,列舉),簡單的描述就是將自己定義的參考值或名稱,集合在一起而這個集合在一起的型態...
        2)    列舉()
               
C語言中,當要定義一個常數時,可以利用巨集或列舉,如下...

17.      陣列
       
在電腦的記憶體中,任何維度的陣列,以位址的觀點去看,皆是一維的陣列...

18.      浮點數顯示問題
       
介紹C++中,如何利用manipulator(操控器)來顯示浮點數的數值...

19.      XSleep   
       
從範例XSleep - An alternative to the Sleep() function學習Thread...

20.      name mangling    
        Name Mangling》又稱為《Name Decoration》目的讓各個overloaded function有一個獨有的辨認名稱。...

21.      extern "C"
       
C++的模組或檔案中要使用到C所撰寫的函式時,若不加extern "C"時會遇到無法解析外部的symbol...

22.      Console函數
       
收集以利用Windows提供的函式,來實作有關Console的函式...

23.      不定參數[pdf]
       
C語言中,當函數的argument list出現ellipsis(),表示該函數需要使用到variable argument lists (不定參數串列)或稱...

24.      不定參數講座
       
從例子中去學習不定參數的觀念...  

25.      Alignment
       
在一個32位元的平台上,資料在4的倍數的位址上,CPU存取速度較快,這與CPU的硬體架構有關。...

26.      Short-Circut Eval
         簡單來說,決定一個expression的結果,不需要估計到所有的operandsoperators ...

27.      Multimedia Timer + Event Object Example[pdf]
      
如何利用Multimedia TimerEvent Object,來產生一個每T milliseconds就顯示一次系統時間應用  ...

28.      Term of Dynamic Allocation
       
何謂Memory FragmentationMemory LeakDangling pointers...   

29.      Callback function[pdf]
           
何謂Callback function

30.      Callbacks In C++[pdf]
     . How to use class member functions as callbacks?
     .Call a member function from a friend callback function?

31.      Singleton Design Pattern
      
 Protected constructor, copy constructor and assignment operator, and POD types

 Visual C++ Series...

1.      設定「執行 VC 環境變數批次檔」

2.      內部編譯器錯誤: 發生嚴重錯誤 C 1001
   
fatal error C1001: INTERNAL COMPILER ERROR(內部編譯器錯誤: 發生嚴重錯誤 C 1001)

3.      Visual Studio 6.0 Service Pack 6 中修正錯誤的清單
    Service Pack
是累積發佈的。因此,Service Pack 中所修正的錯誤,在日後發行的 Service Pack 中也會加以修正。

4.      Console Functions
   
游標前往指定的座標、設定游標的顯示比例、取得目前座標值、設定文字顏色與背景顏色、設定console視窗大小 、Console Window成全螢幕 

5.      Stack Frame剖析
       
這篇文章以VC6.0 Debug模式下的Disassembly程式來做說明,要看Disassembly視窗...       

6.      VC 6.0 Configuration
       
Visual C++ 6.0中新增新的Configuration...

7.      pragma 
       
pragma是一個可用來動態調整編譯器編譯選項的指令(directive),依據編譯器而定,不同的編譯器會有所出入... 

8.      Visual C++ 6.0為編譯器,在程式碼中加入組語
    只需要在程式碼中加入下列的程式區塊
        __asm{
            ...
            ...
        }

9.      使用Visual C++ 所提供的工具來建立和維護類別[pdf]
   
利用Visual C++提供的功能來建立和維護C++類別,有助於大型專案的開發...

10.  避免多重引入同一個標頭檔[pdf]
   
Visual C++中提供相當多的巨集(Macro)供使用,介紹「OneTimeInclude...

11.  Precompiled header(先行編譯標頭檔)[pdf]
 
  -    stdafx.h
    -    procompiled header

12.  Password Protection[pdf]

 Web Articles

1.      Jserv's blog C99 offsetof macro
       
定義在stddef.h內的offsetof,定義為 #define offsetof(s,m) (size_t)&(((s *)0)->m) ...

  1. Q.  I came across some code that declared a structure like this:
3.                        struct name {
4.                     int namelen;
5.                     char namestr[1];
6.                   };
7.                 and then did some tricky allocation to make the namestr array act like it had several elements, with the number recorded by namelen. 
   How does this work? Is it legal or portable? 
8.             Struct hack in C9X -- The New C Standard
9.              
10.          Structs: the last member may have an incomplete array type.
11.           (This is a way to codify the well-known "struct hack" that was widely used and 
12.          in practice worked on nearly every compiler.) The idea is illustrated by the following piece of code: 
  1.  

struct s {int n; double d[];};
struct s *p1, *p2;
size_t sz;

sz = sizeof (struct s); // sz == offsetof (struct s, d)

p1 = malloc (sizeof (struct s) + 8 * sizeof (double));
p2 = malloc (sizeof (struct s) + 5 * sizeof (double));

/*
   p1 behaves now as if it had been declared as

   struct {int n; double d[8];} *p1;

   p2 behaves now as if it had been declared as

   struct {int n; double d[5];} *p2;
*/

 

14.          Note that the specification as given in the Committee Draft implies that there be no padding before the 
15.          variable last member, or, if there is, that it be included in sizeof (struct s). 
16.       Using MFC to Host a WebBrowser Control
17.          
18.       This tutorial explains how to use the Microsoft Foundation Classes (MFC)  to add a WebBrowser control to your C++ application.
19.          Full Screen Display and Implementing Drag to Move Dialogs 
20.           
21.       C++ Q&A Full Screen Display and Implementing Drag to Move Dialogs -- MSDN Magazine, December 2002.
22.         VideoNet  - Peer to peer video conference application.
23.          
24.       VFW (Video for Windows), Winsock, H.263 codec
25.         Lookup and Display Win32/COM Error Strings With One Line of Code By Brian Hart. 
26.         Step 1: Add code to STDAFX.H
27.         #include <comdef.h> // Compiler COM support
28.          
29.         Step 2: Add _com_error calls to your application
30.         // Display error message when calling Win32 Functions
31.         AfxMessageBox(_com_error(GetLastError()).ErrorMessage(),MB_ICONSTOP);
32.          
33.          
34.         // Display error message when using COM functions
35.         // For example,
36.         // Always must be called before using COM functions
37.         CoInitialize(NULL); 
38.          
39.         HRESULT hResult = CoCreateInstance(CLSID_IAmDumb,NULL, CLSCTX_LOCAL_SERVER,IID_IAmDumb,(void**)&pUnk);
40.          
41.         if (FAILED(hResult)) {
42.                        AfxMessageBox(_com_error(hResult).ErrorMessage(),MB_ICONSTOP);
43.         }
44.          
45.       CoUninitialize(); // Call so Windows can clean up
46.       C++ Operator Precedence
47.       Single Write Multiple Read
48.       C++ Algorithms next_permutation() at Mark Nelson
  1.  

 What's the problem?

1.      顯性的指標轉換 - 物件指標[pdf]
    -    顯性地轉換物件指標
    -    Stack Frame
    -    0xC0000005 : Access Violation

2.      指定運算子 - 隱性地型態轉換[pdf]
    -   
型態轉換
    -    getc()
函式
    -    EOF

3.      變數宣告與其顯示指定格式[pdf]
    -   
隱性地物件轉型
    -    Sign Extension Error

 Simple Application

1.      文字加密

2.      亂數應用

3.      方向鍵應用

4.      時間函數

5.      高解析度計時器

6.      計算執行時間

7.      執行緒

8.      排序文字行

9.      計算 Frame Rate

10.  梯形積分法

 Image Topic

  1. Bitmap
       
    介紹BMP檔案的格式(Format)及利用程式來讀取
  2. Bitmap raster image[pdf]
       
    介紹YUV轉成RGB、利用Win32 API顯示RGB raster data、存成.BMP
  3. Subsampling[pdf]
       
    介紹在圖片中的取樣方式4:4:44:2:2...,並以程式來實作
  4. Histogram
  5. SNR&PSNR[pdf]

 Tutorial & Sample Code

 Note

  1. Screen coordinate and Client coordinate[pdf]
    -    ScreenToClient and ClientToScreen
  2. CxImage

 Others

1.      International Standard C++ ISO/IEC 14882

2.      Visual C++ Concepts: Building a C/C++ Program : Debugging a Release Build

3.      Incompatibilities Between ISO C and ISO C++

4.      C++之父 Bjarne Stroustrup's homepage  

5.      C++ Library Reference

6.      C Program Language Reference

7.      C++ Program Language Reference

8.      ACM
+    Lucky貓的ACM園地   
+    ACM Online Judge Guide   

9.      Forum
    1)    Experts-Exchange
    2)    CodeGuru Forums

    3)    Discussions in microsoft.public.vc.mfc

10.  Tools
    1)    Nopaste
            allows people to paste chunks of code for others to view. Pastes will automatically remove themselves after 24 hours.
    2)    ImageShackR - Hosting
            ImageShack's mission is to provide an easy-to-use image hosting service.

    3)    Make a shorter url
            +    TinyURL.com
            +    0rz.TW

 

 Entertainments

1.          MyP2P Free Live sports on your PC Live football, Live NBA ,Live MLB and more!

Hosted by www.Geocities.ws

1