Time of Update: 2018-07-18
/**********************************************************///name : datetime.h//function : 時間日期類的定義//copyright :
Time of Update: 2018-07-18
文章收藏, 網上資源, 軟體技術, 電腦與網路 邢紅瑞 發表於 2006-10-11 14:30:50
Time of Update: 2018-07-18
C++中標頭檔的命名規則,因為C++是從C語言發展而來的,為了與C相容,C++保留了C語言中的一些規定,其中就包括用.h作為尾碼的標頭檔,比如大家所熟悉的:stdio.h、math.h和string.h等。但後來ANSI/ISO
Time of Update: 2018-07-18
很多時候寫windows程式都需要結合多線程,在.net中用如下得代碼來建立並啟動一個新的線程。 public void ThreadProc(); Thread thread = new Thread( new ThreadStart( ThreadProc ) ); thread.IsBackground = true; thread.Start();
Time of Update: 2018-07-18
c語言提供記憶體動態分配的函數有:malloc、calloc、realloc,在使用這些函數時必須包含其標頭檔,分別為:<malloc.h>、<stdlib.h>、<alloc.h> 1) malloc 函數: void *malloc(unsigned int size)
Time of Update: 2018-07-18
有了malloc/free 為什麼還要new/delete 。malloc 與free 是C++/C 語言的標準庫函數,new/delete 是C++的運算子。它們都可用於申請動態記憶體和釋放記憶體。對於非內部資料類型的對象而言,光用maloc/free 無法滿足動態對象的要求。對象在建立的同時要自動執行建構函式, 對象在消亡之前要自動執行解構函式。由於malloc/free
Time of Update: 2018-07-18
1、簡介 在WMI中,通過Win32_Processor對象可以擷取磁碟機的相關資訊: ManagementClass mc = new ManagementClass("Win32_CDROMDrive"); ManagementObjectCollection moc = mc.GetInstances();
Time of Update: 2018-07-18
hadoop streaming是一個hadoop的工具,可以使使用者使用其他語言編寫mapreduce程式,使用者只需要提供Mapper和Reducer,就可以執行Map/Reduce作業 相關資料請看hadoop streaming官方文檔 1、下面以實現WordCount為例,使用C++編寫Mapper和Reducer Mapper.cpp代碼如下: #include <iostream>#include <string>using
Time of Update: 2018-07-18
(1)、下載visual studio 2010 (2)、建立工程 (3)、建立標頭檔 (4)、建立資源檔 (5)、CGoods.h檔案 class CGoods{private:char Name[21] ; //名稱int Amount ; //數量float Price ; //價格float Total_value ; //總價值public:CGoods(void);~CGoods(void);void RegisterGoods(char*
Time of Update: 2018-07-18
1. 輸入一串字元,計算其中空格的個數。 #include <stdio.h> #include <string.h> int function(char *str); int main() { char str[30]; int num = 0;
Time of Update: 2018-07-18
/* cblockingdeque.h 描述了阻塞隊列的實現 */ #ifndef _H_CBLOCKINGDEQUE_INCLUDE_ #define _H_CBLOCKINGDEQUE_INCLUDE_ #include <mutex> #include <deque> #include <condition_variable> //阻塞式隊列 template <typename T> class CBlockingDeque {
Time of Update: 2018-07-18
/* thread.cpp 示範了建立線程的多種方法 */ #include <iostream> #include <sstream> #include <functional> #include <thread> #include <future> #include <unordered_map> #include <vector> #include <algorithm>
Time of Update: 2018-07-18
大家都知道資料在電腦中都是按位元組來儲存了,1個位元組等於8位(1Byte=8bit),而電腦只能識別0和1這兩個數,所以根據排列,1個位元組能代表256種不同的資訊,即28(0和1兩種可能,8位排列),比如定義一個位元組大小的不帶正負號的整數(unsigned
Time of Update: 2018-07-18
public class QueueManage { /// /// 發送對象到隊列中 /// /// 隊列名稱,因為隊列名稱在一個應用中應該不改變的,所以大家最好寫在設定檔中 /// 要發出去的對象 public static void SendQueue(string QueuePath,MyBase.SmsQueue sq) { System.Messaging.MessageQueue mqSend=new
Time of Update: 2018-07-18
//一些C++中字串處理的函數集合 #include <algorithm>#include <vector>#include <string> class MyString{private: //public: //將指定字串轉換為大寫 const std::string& upperstring(std::string
Time of Update: 2018-07-18
出自:http://blog.ednchina.com/lijin305/62382/message.aspx -------------------------------------------------------------------------------- #include < windows.h > void clrscr(void); void clreol(void); void clreoscr(void); void gotoxy(int ,int ); /
Time of Update: 2018-07-18
工作後第一篇技術blog,抽象出一些小技術,記錄下。 刪除單個檔案直接用 File.Delete; 刪除檔案夾下子檔案夾及子檔案用FileInfo和DirectoryInfo,根目錄下先刪檔案,再遞迴進入子檔案夾。注意許可權不足導致的無法刪除現象,刪除前統一改成Normal屬性。 ClearSingleFile(); ClearDirectory(); /// <summary>
Time of Update: 2018-07-18
1.關於backspace getchar從標準輸入的緩衝區讀字元,backspace根本進不了緩衝區。所以應該使用無緩衝的讀字元函數:getch(),包含在標頭檔<conio.h>中。
Time of Update: 2018-07-18
輸入下述8個國家名字的字串:CHINA、JAPAN、KOREA、INDIA、CANADA、AMERICAN、ENGLAND和FRANCE,將這些國名按字典順序排序。 #include<stdio.h> #include<string.h> void main() {
Time of Update: 2018-07-18
C預先處理命令 一.什麼是預先處理命令