Time of Update: 2015-04-07
標籤: 地址:http://blog.csdn.net/matrix_laboratory/article/details/136692112. socket()[cpp] view
Time of Update: 2015-04-07
標籤:c程式 萬年曆 // Zeller公式確定星期幾,w=y+[y/4]+[c/4]-2c+[26(m+1)/10]+d-1// y是年份取最後兩位,c是世紀減1,m是月份,如果m是1月和2月,則m換成13和14,d是日期,[]表示取整,w除以7之後的餘數就是星期幾,如果餘數為0,就是星期日#include <stdio.h>int main(){int year, month,
Time of Update: 2015-04-07
標籤:單詞序翻轉 技巧 // 把student a am i 變成 i am a student//思想:把每個單詞翻轉,然後再把整體翻轉#include <stdio.h>#include <string.h>//把每次解析出來的單詞翻轉 void fanw( char *l,char *r ){char* left = l;char* right = r;char temp;while( left &
Time of Update: 2015-04-07
標籤:字串 單詞反轉 c語言 局部反轉 字串翻轉 //將字串順序翻轉//如: I am a student 轉成:student a am I#include <stdio.h>#include <string.h>void fanw( char *left,char *right )
Time of Update: 2015-04-07
標籤:刪除目錄1.介紹 用到shlwapi.h和tchar.h標頭檔。 shlwapi.h是shlwapi.dll標頭檔,shlwapi.dll(Microsoft Shell Light-weight Utility Library)中定義了路徑相關的操作,也包括了部分檔案操作函數。由於shlwapi.dll屬於Microsoft Windows Shell,因此這些檔案操作特點與通過Shell進行檔案操作類似。 下面列出部分常用的檔案操作相關函數。 函數名 作用
Time of Update: 2015-04-07
標籤:間接定址 c++ 演算法 之前學過,資料描述方法中有公式化描述,鏈表描述,間接定址和類比指標,在之前已經將公式化描述和鏈表描述通過代碼的形式展現出來了,現在貼出簡介定址的代碼。其中簡介定址是融合了公式化描述和鏈表描述的有點,使用一個指標表來記錄資料的位置,指標表相當於一個數組,這樣在插入,刪除的時候,其中的資料的位置並沒有發生變化,而僅僅就是指標表的指向發生了變化,同時很多操作又能像公式化
Time of Update: 2015-04-07
標籤: 炒了個栗子#include <stdio.h>#define N1 (5)#define N2 (7)#define N3 (3)int main(){ int *ip; int *large_ip; int *small_ip; //記憶體空間的首地址 ip = (int *)malloc(N1*sizeof(int)); if(ip == NULL){
Time of Update: 2015-04-07
標籤:c++11 c++ 讀書筆記 1.const關鍵字當我們定義一種變數,不希望改變其值的時候,使用const關鍵字來修飾。即常量。使用的時候一定要注意,定義一個常量的時候一定要初始化,且只能在初始化的時候賦值,之後不能進行修改。2.const引用這個地方經常糾結,這次一定要搞懂。常量引用不是引用是個常量,而是引用的對象是個常量。檢測常量引用。實際上是對const的
Time of Update: 2015-04-07
標籤:個人總結:1.int **p和 int a[M][N]之間的區別: 1) int **指向指標的指標;而後者的類型是數組名,類型為 int (*)[N],即指向的是整個一行。 2) (a+1)
Time of Update: 2015-04-07
標籤:一、 函數的定義目的:封裝一個常用的功能,實現函數的調用。格式:傳回值類型 函數名(形式參數列表) { 函數體}二、函數調用及函數的形參,實參 #include <stdio.h>//形式參數,簡稱形參int sum(int num1,int num2){//函數體內部不能定義和形參一樣的變數//int num1;return num1 + num2;}char test(){ return ‘a‘;}int main(){ int a = 10;
Time of Update: 2015-04-07
標籤:一、ActionAction封裝的方法沒有參數也沒有傳回值,聲明原型為:1 public delegate void Action();用法如下:1 public void Alert()2 {3 Console.WriteLine("這是一個警告");4 }5 6 Action t = new Action(Alert); // 執行個體化一個Action委託 7 t();如果委託的方法裡的語句比較簡短,也可以用Lambd運算式直接把方法定義在委託中,如下:1
Time of Update: 2015-04-07
標籤:Initializing Array Elements int[] myIntArray = new int[5] { 2, 4, 6, 8, 10 }; // longer syntax int[] myIntArray = { 2, 4, 6, 8, 10 }; // shorter syntax定義2行3列的int 類型的數組int [ , ] myRectangularArray = new int[2,3];The
Time of Update: 2015-04-07
標籤:我想實現:有一引用變數,如Object A; 然後有一個資料區塊,比如用結構體記錄一些資訊,其中包括A的引用資訊。然後一個程式段通過操作這個資料區塊,能夠給A付值。這在C++裡應該比較容易實現,比如用指向指標的指標等,但在C#裡好像沒有實現的方法。C++例子大概如下:class A{}A* a;struct X{ A** P;}程式段int main(){&nbs
Time of Update: 2015-04-07
標籤:使用前需加上: using System.Diagnostics; 同步重新導向代碼如下: 第一步:確定必要成分1 Process process = new Process();2 process.StartInfo.UseShellExecute = false; // 是否使用外殼程式 3 process.StartInfo.CreateNoWindow = true; //是否在新視窗中啟動該進程的值 4
Time of Update: 2015-04-07
標籤:An interface is a contract(協定) that guarantees to a client how a class or struct will behave.When a class implements an interface(實現一個介面), it tells any potential(可能的) client “I guarantee I’ll support all the methods, properties,
Time of Update: 2015-04-07
標籤: private void btnsuggestinfo_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add("單號", typeof(string)); dt.Columns.Add("項次", typeof(decimal)); dt.Columns.Add(
Time of Update: 2015-04-07
標籤:xml檔案如下:<?xml version="1.0" encoding="utf-8" ?><info> <error> <errorid errorNUM="E00001"> <content>未登入,請登入</content> </errorid> </error> <error> <errorid
Time of Update: 2015-04-07
標籤:String轉int主要有四種方法1. int.Parse()是一種類容轉換;表示將數字內容的字串轉為int類型。 如果字串為空白,則拋出ArgumentNullException異常; 如果字串內容不是數字,則拋出FormatException異常; 如果字串內容所表示數字超出int類型可表示的範圍,則拋出OverflowException異常;2.
Time of Update: 2015-04-07
標籤:主要使用的是ITextSharp方法,參考文檔:(1)http://www.docin.com/p-23672859.html(2) http://www.cnblogs.com/islands/archive/2008/06/27/1231288.html(3)http://www.cnblogs.com/julyluo/p/3839788.html1,iTextSharp2,service
Time of Update: 2015-04-07
標籤:alias gsl 機器學習 最近讀論文《Large-scale Information Network Embedding》 看到裡面對超大數量的邊進行採樣時採用了Alias Sampling Algotithm,他的優點是可以O(1)的時間採樣。下面涉及了gsl,安裝方法很簡單。 下面是gsl的資料: