Time of Update: 2018-12-06
深度複製就是參考型別的複製淺度複製是實值型別的複製例如:using System;using System.Collections.Generic;using System.Text;namespace Test{ public class Content { public int val; } //此處若是深度複製才繼承ICloneable介面 //public class Cloner : ICloneable public
Time of Update: 2018-12-06
今天閱讀《C/C++程式員面試指南》中指標一塊,以前一知半解的指標問題頃刻間懂了。下面,可以做個測試,如果下面的指標問題你能夠全都解答正確,那麼你的C語言功底真是神一般的了。1.int *p;2.int **p;3.int *p[10];4.int (*p)[10];5.int *p(int);6.int (*p)(int);7.int
Time of Update: 2018-12-06
一 const基礎如果const關鍵字不涉及到指標,我們很好理解,下面是涉及到指標的情況:int b = 500;const int* a = &b; [1]int const *a = &b; [2]int* const a = &b; [3]const int* const a = &b; [4]如果你能區分出上述四種情況,那麼,恭喜你,你已經邁出了可喜的一步。不知道,也沒關係,我們可以參考《Effective
Time of Update: 2018-12-06
CC的HPC體驗上篇說到CC終於換U有了兩台支援虛擬化的機器,開始尋思折騰hpc群集啥的,看看有沒有vmware的高可用先是安裝了兩台HPC,並且安裝了HPC PACK這個HPC群集工具,還安裝過HPC R2這個新的Community Technical Preview,可是沒發現HPC群集有什麼出彩的功能,有點無奈了,木有什麼可喜的功能和突破Hpc pack的建立是由前端節點和其他電腦節點群組成
Time of Update: 2018-12-06
考慮以下函數:void f() { Investment *pInv = createInvestment(); // call factory function ... // use pInv delete pInv; // release object }問題: delete pInv一定會被執行嗎?當然不是!隨便列舉幾種情形。有可能在這個函數的 "..."
Time of Update: 2018-12-06
第6章 函數設計函數是C++/C程式的準系統單元,其重要性不言而喻。函數設計的細微缺點很容易導致該函數被錯用,所以光使函數的功能正確是不夠的。本章重點論述函數的介面設計和內部實現的一些規則。函數介面的兩個要素是參數和傳回值。C語言中,函數的參數和傳回值的傳遞方式有兩種:值傳遞(pass by value)和指標傳遞(pass by pointer)。C++ 語言中多了引用傳遞(pass by
Time of Update: 2018-12-06
來新公司半年了。 一直做.net c#開發,加上以前做.net
Time of Update: 2018-12-06
using System; namespace ShellSorter { public class ShellSorter { public void Sort(int [] list) { int inc; for(inc=1;inc<=list.Length/9;inc=3*inc+1);
Time of Update: 2018-12-06
首先有一個有趣的東西:如何不通過對象來訪問對象中的虛函數呢?我們來看下面這樣一段代碼: 1 #include <iostream> 2 using namespace std; 3 4 typedef void (*Fun)(void); // 函數指標 5 6 class A{ 7 public: 8 virtual void testA(void){ 9 cout<<"A is Print."<<endl;10 }11
Time of Update: 2018-12-06
第一部分 準系統 第4章 類型和聲明 1. 名字。用於較大的範圍的名字應該是不想對比較長的更加明確的名字,例如vector、Window_with_border和 Department_number。然而,如果在很小的範圍裡只使用那些短小而熟悉的名字,如x、i和p,代碼會顯得更清晰些。....
Time of Update: 2018-12-06
關於本條款,作者一直在向我們強調一個觀點,那就是不要把C++當做我們學過的單純語言,而要把C++當做一個具有多個獨立特性的聯邦語言。1. C++由C發展而來,它相容一切C的文法特性,因此,C++國度裡的第一個聯邦——C語言,即面向過程的代表語言。2. 從一開始,C++引入了物件導向的特性,即C++一開始的名稱C with classes,這是C++的第二個聯邦——物件導向語言。3. 接著就是C++
Time of Update: 2018-12-06
protected void Page_Load(object sender, EventArgs e) { HttpCookie cookies = Request.Cookies["platform"]; //判斷是否有cookie值,有的話就讀取出來 if (cookies != null && cookies.HasKeys) {
Time of Update: 2018-12-06
在一個國外網站上看到的,太NB了,要是這些問題都能完全搞懂的話,C++也差不多了How many ways are there to initialize a primitive data type in C++ and what are they?Why should you declare a destructor as virtual?What does it mean that C++ supports overloading?What are examples of overloadi
Time of Update: 2018-12-06
相信用過window7 的都知道window7工作列新增加了一些功能比如JumpList(捷徑清單), 這是IE8的Jumplist,現在利用Visual Studio 2010 和C#4.0 我們可以編寫Code來改變Jumplist和自訂。首先,用VS2010建立一個windowform project(注意是 .Net 4.0的架構),然後右擊選擇解決方案(螢幕右邊)下的reference點Addreference(添加引用)這是我們要添加兩個Dll檔案 路徑為:C:\Program
Time of Update: 2018-12-06
學習c#,進行格式驗證時,自己花了很長時間學習了Regex,花了點時間,整理了一下,供大家參考一下,有什麼錯誤,希望大神提出來. using Sysyem.Text.RegularExpressions.
Time of Update: 2018-12-06
1 int myatoi(char* str) 2 { 3 int ret=0; 4 int sign = 1; 5 if(*str=='-')//指標的值不是負數 *是取值的意思 &取地址的意思 6 { 7 sign=-1; 8 }else 9 {10 ret=ret*10+(*str-'0');//通過ascii碼轉換11 }12 str++;13 while(*str!='\
Time of Update: 2018-12-06
DEMOusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Drawing.Imaging;namespace 圖片{ public partial class Form1 : Form {
Time of Update: 2018-12-06
叢集線性群集非線性群集線性群集直接存取群集(數組,字串,結構)ArrayList,StringBuild,Struct順序存取群集(棧,隊列)Stack,Queue索引群集(散列表,字典)Hashtable,Directionary非線性群集層次群集(樹-二叉樹,堆)組群集(集合,圖,網路) 通過CollectionBase類實現Collection類View Code class Collection:CollectionBase { public void
Time of Update: 2018-12-06
(1)拼接產生SQL語句: string sql = "insert into czyb(yhm,mm,qx) values('" + txtName.Text + "','" + txtPassword.Text + "','" + cmbPriority.Text + "')"; OleDbCommand cmd = new OleDbCommand(sql, conn);
Time of Update: 2018-12-06
什麼是進程?當一個程式開始運行時,它就是一個進程,進程包括運行中的程式和程式所使用到的記憶體和系統資源。而一個進程又是由多個線程所組成的。什麼是線程?線程是程式中的一個執行流,每個線程都有自己的專有寄存器(棧指標、程式計數器等),但代碼區是共用的,即不同的線程可以執行同樣的函數。什麼是多線程?多線程是指程式中包含多個執行流,即在一個程式中可以同時運行多個不同的線程來執行不同的任務,也就是說允許單個程式建立多個並存執行的線程來完成各自的任務。多線程的好處:可以提高CPU的利用率。在多線程程式中,一