Time of Update: 2015-05-11
標籤: #include<unistd.h>#include<sys/types.h>#include<pwd.h>#include<stdio.h>int main(int argc,char **argv){ pid_t my_pid,parent_pid; pid_t te ; my_pid=getpid(); parent_pid=getppid(); printf("mypid is [%d]\t
Time of Update: 2015-05-11
標籤:xl_blocking_queue.h ?123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354#ifndef SRC_COMMON_BLOCKING_QUEUE_H_#define SRC_COMMON_BLOCKING_QUEUE_H_#include <boost/thread.hpp>#include
Time of Update: 2015-05-11
標籤:C# 線程知識--使用ThreadPool執行非同步作業
Time of Update: 2015-05-11
標籤:ctime 這個用的最多就是隨機數的時候,現在用一用其他特性.#include <stdio.h>#include <time.h>int main(){ time_t sec; ///typedef long time_t struct tm * curTime; sec = time(NULL); ///擷取時間,從1970.1.1到現在的秒數,也可以寫成 time(&sec); curTime =
Time of Update: 2015-05-11
標籤:c++ 物件導向 設計模式 代理模式 代理模式(Proxy):為其他對象提供一種代理以控制對這個對象的訪問。應用情境:1.遠程代理,也就是為一個對象在不同的地址空間提供局部代表,這樣就可以隱藏一個對象存在於不同地址空間的事實。
Time of Update: 2015-05-11
標籤:c語言 遞迴調用 字串反轉 字串長度 問題描述: 編寫一個函數reverse_string(char *srring)(遞迴實現) 實現:將參數字串中的字元反向排列。 &
Time of Update: 2015-05-11
標籤:c++ 最大數 最小數 輸入 //輸入8個數,求出最大值與最小值#include <iostream>using namespace std;int max(int b[],int n),min(int b[],int n);int main(){int a[8];cout<<"輸入8個int型數 :";for(
Time of Update: 2015-05-11
標籤:c++ 字串 反向輸出 函數 <pre name="code" class="cpp">// 反向輸出字串#include<iostream>#include<string.h>using namespace std;void f(char p[]);int main(){
Time of Update: 2015-05-10
標籤:編輯器是使用環境turboc的IDE,使用dos視窗中的edit作為編輯器,有點類似於vim;使用的是xp-sp3的虛擬機器上的系統。Nisy說要有兩種語言,指令碼語言以及一個底層語言,比如現在我的python和正在學習的C。目前的狀態就是兩個都不精。講完C語言的學習模式以及編程的工作模式以及記憶體以及1+1的重要性後,開始使用edit編輯器學習文法,以及實現第一個程式1+1=?1、編輯測試檔案test.c圖1 dos視窗命令列第一行cd turboc2進入turboc2的C程式開發環境,
Time of Update: 2015-05-10
標籤:(1)如果C++程式中使用了帶尾碼".h"的標頭檔,那麼不必在程式中聲明命名空間,只需要檔案中包含標頭檔即可;(2)C++標準要求系統提供的標頭檔不帶尾碼".h",但為了表示C++與C的標頭檔既有聯絡又有區別,C++中所用標頭檔不帶尾碼".h",而是在C語言的相應標頭檔名之前加上首碼c:(3)自訂的標頭檔通常帶尾碼“.h",系統標準庫檔案不帶尾碼“.h"。(4)因為標準庫非常的龐大,所程式員在選擇的類的名稱或函數名時就很有可能和標準庫中的某個名字相同。所以為了避免這
Time of Update: 2015-05-10
標籤:#include "codechange.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <Windows.h>#include <locale.h>wchar_t *ANSITOUnicode(const char* str){ int textlen = 0;
Time of Update: 2015-05-10
標籤:主要的輸入輸出函數有6種:cin, cin.get() , cin.getline() ,getline() , gets() ,getchar()cin(1)根據變數的類型讀取資料結束條件:斷行符號鍵、空格鍵、TAB結束符的處理:緩衝區中丟棄使輸入結束的結束符(斷行符號鍵、空格鍵、TAB)#include <iostream>using namespace std;void main(){ int a,b; cin>>a>
Time of Update: 2015-05-10
標籤:C#支援通過多線程並行地執行代碼,一個線程有它獨立的執行路徑,能夠與其它的線程同時地運行。一個C#程式開始於一個單線程,這個單線程是被CLR和作業系統(也稱為“主線程”)自動建立的,並具有多線程建立額外的線程。這裡的一個簡單的例子及其輸出:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using
Time of Update: 2015-05-10
標籤:common Business-Oriented LanguageBASIC(Beginner‘s All-purpose Symbolic Instruction Code)1972 C1983 C++1995 Javaportability performanceObject-Oriented 功能文法子集subset;適用範圍sphere scope range of Applicationcompile 解釋parse explain機器指令 機器代碼 machine
Time of Update: 2015-05-11
標籤:What is Entity FrameworkEntity Framework (EF) is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually
Time of Update: 2015-05-11
標籤:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication4{ delegate T NumberChanger<T>(T n); class Program { static int num = 10; public static int AddNum(int p)
Time of Update: 2015-05-10
標籤:作用:協助我們初始化對像(給對像的每個屬性依次的賦值)建構函式是一個特殊的方法1、建構函式沒有傳回值,連void也不能寫2、建構函式名稱要和類名一樣3、建立對像時會執行建構函式4、建構函式可以重載類中預設有一個建構函式(隱藏的),如果你建立了一個建構函式,不管是有參數的,還是無參數的,他預設的那個無參數的建構函式都會消失,如果你需要無參的就要重新自已寫students 類using System;using System.Collections.Generic;using
Time of Update: 2015-05-10
標籤: LINQ,Language-integrated Query (LINQ)(Language Integrated Query)是一組用於c#和Visual Basic語言的擴充。它允許編寫C#或者Visual Basic代碼以查詢資料庫相同的方式操作記憶體資料。類似於SQL。
Time of Update: 2015-05-11
標籤:c++ 閏年 天數 函數 //判斷是否為閏年,是該年的哪一天#include <iostream>using namespace std;int sum(int month,int day);int leap(int year);int main(){int year,month,day;cout<<"請輸入一個日期: &
Time of Update: 2015-05-10
標籤:如果現在能夠組成1...x 的面值,加上一種 x+1 面值的紙幣,就能組成 1 ... x + C * (x + 1)的面值。因為如果面值是 k < (C+1)*(x + 1),我們可以用 k / (x + 1) 張 x+1 面值的紙幣,並用原來的紙幣組成 k % (x + 1),就得到了 k