原创 變參函數

java   public ver( double .... num ) {      double tmp = 0;      for( double t : num )             tmp += t;      for(

原创 複習c++: 繼承 , static, cerr , cout , clog

繼承和多態   1。友元是不可以被繼承的:基類的友元不可以訪問派生類的成員;同樣,一個友元的派生類也不可以訪問定義友元的類。 2。除static成員外,每個派生類都保存了基類的一個副本,包括派生類不能訪問的 private成員;stati

原创 destructor 中的 異常

When an exception is thrown for a class object with a destructor, the destructor for the temporary object thrown is not

原创 bucket sort 桶排序

桶排序(bucket sort)從一個一維的待排序的正整數數組和一個二維整數數組開始,其中二維數組的行下標是從0到9,列下標是從0到n-1,n是一維數組中待排序值的個數。這個二維數組的每一行都成爲一個桶。編寫一個函數bucketSort,

原创 java中import用法

  單類型導入(single-type-import),例如import java.io.File; 按需類型導入(type-import-on-demand),例如 import java.io.*; 關於這兩種導入類型大家各有所愛,衆

原创 java 網絡編程的一些函數

  TCP   Server   1  ServerSocket server = new ServerSocket( portnum , queueLength); 2  Socket connect = server.accept()

原创 指向成員的指針

C++中指向成員的指針   一個類有兩種基本的成員:函數成員和數據成員。同樣的,指向成員的指針也有兩種:指向函數成員的指針和指向數據成員的指針。後則其實並不常用,因爲類一般是不含有公共數據成員的,僅當用在繼承用C寫的代碼時協調結構(str

原创 c++ , java unwind 展開過程 ,看不太懂

展開代碼數組按降序排列。發生異常時,操作系統將整個上下文存儲在上下文記錄中。然後調用異常調度邏輯,該邏輯重複執行下列步驟以查找異常處理程序。 使用存儲在上下文記錄中的當前 RIP 來搜索 RUNTIME_FUNCTION 表項,該表項描

原创 java thread

Thread   1.1 public class Myclass implements Runnable   // super class is   Runnable {         public void run()  // 

原创 c++ 數據範圍

int (unsignedint) __int8 (unsigned__int8) __int16 (unsigned__int16) __int32 (unsigned__int32) __int64 (unsigne

原创 exit and ~destructor

今天在 c++ programming language 上看到這樣描述   If a program is terminated using the standard library function exit() ,  the des

原创 轉:Set_New_Handler()

當運算符new找不到足夠大的連續內存塊來爲對象分配內存時將會發生什麼?一個稱爲 new-handler的函數被調用。 對於new-handler的缺省動作是拋出一個異常。然而,如果我們在程序裏用堆分配,至少要用“內存已用完”的信息代替 n

原创 2010 spring OOD proj3 備忘

1 , MSG Node ,    SYSTIME , GetLocalTime( & SYSTIME );  #include<windows.h> //GetLocalTime class MsgNode{public: LType

原创 source file notice

The result of preprocessing is called a translation unit. This unit is what the compiler proper works on and what theC+

原创 lvalue & const

一個對象是被命名的存儲區域或者被指向一塊存儲區域(an object is a named or pointed to region of storage);一個lvalue是一個指向對象的表達式(an lvalue is an expr