Time of Update: 2018-12-04
C++作為一種傳統而古老的程式設計語言存在很多危險的陷阱,不注意時落入即會虛耗許多時間精力去修改調試。為了加快編程的速度 我認為有必要建立一些輔助編程工作的習慣或者說原則 其中:1 若干原則一起工作可以最大限度保證少出錯誤2 有些原則是由其他原則自然推演而來形成樹狀關係3 不同原則樹不保證不會發生衝突 卡拉巴哲學 生命之樹一切皆有源頭皆有歸宿除了小型的無害臨時對象分配在C運行庫維護的stack上
Time of Update: 2018-12-04
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; namespace smsxx { /// <summary> /// Form1 的摘要說明。 /// </summary> public class Form1
Time of Update: 2018-12-04
1.硬體環境不同: C/S 一般建立在專用的網路上, 小範圍裡的網路環境, 區域網路之間再通過專門伺服器提供串連和資料交換服務. B/S 建立在廣域網路之上的, 不必是專門的網路硬體環境,例與電話上網, 租用裝置. 資訊自己管理. 有比C/S更強的適應範圍, 一般只要有作業系統和瀏覽器就行 2.對安全要求不同 C/S 一般面向相對固定的使用者群, 對資訊安全的控制能力很強. 一般高度機密的資訊系統採用C/S 結構適宜. 可以通過B/S發布部分可公開資訊. B/S 建立在廣域網路之上,
Time of Update: 2018-12-04
前幾天由於要做一個小軟體,要求有聲音提示,於是尋找了一下資料,結果很多都用Microsoft.DirectX,還要安裝DirectX SDK,下載半天,還是沒成功。後來又發現了以下方法可以很輕鬆的實現,因此,記錄下來,免得以後再找。1. 添加引用 using MVD = Microsoft.VisualBasic.Devices; 2. 關於Audio 類的說明下面,我們用到的方法是Audio.Play (String, AudioPlayMode) 播放
Time of Update: 2018-12-04
C++取函數地址Luo Weifeng 2010-3-18原文發表至QQ空間,現在轉過來。很多時候我們需要得到一個函數的地址,C中如此,C++中也一樣,如下。void f1() {}class C {public: void f2(){}};#include <stdio.h>;int main(){ printf("%p/n", f1); C c ; void(C::*p)(); p = &C::f2; printf("%p/n", p);}
Time of Update: 2018-12-04
C/C++ 筆試、面試題目大匯總 收藏 新一篇: 簡明x86組合語言教程 | 舊一篇: 組合語言的準備知識--給初次接觸彙編者 1.求下面函數的傳回值(微軟) int func(x) { int countx = 0; while(x) { countx ++; x = x&(x-1); } return countx; } 假定x = 9999。 答案:8 思路:將x轉化為2進位,看含有的1的個數。 2
Time of Update: 2018-12-04
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace comback{ class LogManager { //<summary> //儲存日誌的檔案夾 //<summary> private static string logPath =
Time of Update: 2018-12-04
這個沒含量,以前也沒用過treeview控制項,初次用。需求:F盤下有年目錄,下面有月目錄,再下面就是天的檔案,用treeview顯示下,折騰了一兩個小時,搞出來了。//初始化樹形列表值 private void Test_Load(object sender, EventArgs e) { //基目錄 string basePath = @"F:\comback\Release\log";
Time of Update: 2018-12-04
//由於日誌中含有中文,用常用的LoadFile方法會含有亂碼,所以用這種流的方式,一行一行的讀。 string fullPath = @"F:\comback\Release\log\20121218.Log"; StringBuilder sb = new StringBuilder(""); StreamReader streamReader = null; try {
Time of Update: 2018-12-04
//由於日誌中含有中文,用常用的Navigate()方法會含有亂碼,所以用這種流的方式,一行一行的讀。 string fullPath = @"F:\comback\Release\log\20121216.Log"; StringBuilder sb = new StringBuilder(""); StreamReader streamReader = null; try
Time of Update: 2018-12-04
一段伺服器端設定檔,一段用戶端設定檔,一段下載代碼。RemoteXmlFile.xml<?xml version="1.0" encoding="utf-8"?><configuration> <Item key="client" value="20121228" content="tlnews001,tlnews002,tlnews003" size="3" /> <Item key="renbao" value="20121228"
Time of Update: 2018-12-04
今天學了一下C#的迴圈語句,其實跟C語言是一樣的,剛開始可能不知道什麼時候用while或for語句,多用幾次基本上都能理解,還要注意continue、break、return的區別。 continue只是中斷本次迴圈,不執行它後面的迴圈體語句,並進行下一次迴圈。 break是跳出整個迴圈體,執行迴圈體外部後面的語句。 return是不僅是跳出整個迴圈體,還結束整個函數的執行,所以它後面的語句,不管是在循2011-04-17環體內或在迴圈體外,都不執行,直接返回。2011
Time of Update: 2018-12-04
Generics in C#Generics are the most useful C# 2.0 language extensions, beside Anonymous methods, Iterators, Partial types And Nullable types.What are generics?Generics permit classes, structs, interfaces, delegates, and methods to be parameterized
Time of Update: 2018-12-04
#include <afx.h>class Animal : public CObject{ DECLARE_DYNAMIC(Animal)};class Dog : public Animal{ DECLARE_DYNAMIC(Dog)};class Cat : public Animal{ DECLARE_DYNAMIC(Cat)};class CFoo{public: void AnimalSays(Animal*);};int main(int argc,
Time of Update: 2018-12-04
一.Windows服務介紹: Windows服務以前被稱作NT服務,是一些運行在Windows NT、Windows 2000和Windows XP等作業系統下使用者環境以外的程式。在以前,編寫Windows服務程式需要程式員很強的C或C++功底。然而現在在Visual Studio.Net下,你可以運用C++或Visual C#或Visual
Time of Update: 2018-12-04
今天看《Effective C++》裡面提到一種單例模式的方法,和《大話設計模式》裡面有點差別。但是思想都是一樣的,在這裡用c++簡單寫了一下,以後如果忘了,可以回過來瞧瞧。單例模式就是一個類只有一個對象,想要再多也沒門。它的好處就是:一個類只能產生一個執行個體,這是這個類的責任,其他類只需要調用而不用管理這個類的數量,這也體現了一種責任的分配。《Effective
Time of Update: 2018-12-04
private void button1_Click(object sender, System.EventArgs e) ...{ ConnectionOptions opt=new ConnectionOptions(); opt.Username=UserBox.Text; opt.Password=PassBox.Text; ManagementScope scope=new ManagementScope("//"+IPbox.Text+"/root/cimv2",opt); try
Time of Update: 2018-12-04
函數指標最大的用處在於它可以被一個模板方法調用,這是我在學java的設計模式時領悟到的.例如,有兩個函數的流程結構完全一致,只是內部調用的具體函數不同,如下所示:void func1(){ //一段流程代碼和面向方面的代理,如安全檢查,日誌記錄等 int sum = add( x , y); //一段流程代碼和面向方面的代理,如安全檢查,日誌記錄等}void func2(){
Time of Update: 2018-12-04
printf文法: #include <stdio.h> int printf( const char *format, ... );printf()函數根據format(格式)給出的格式列印輸出到STDOUT(標準輸出)和其它參數中。傳回值是輸出的字元數量。sprintf文法: #include <stdio.h> int sprintf( char *buffer, const char *format, ... );sprintf()函數和printf(
Time of Update: 2018-12-04
[參考來源:http://www.csdn.net/article/2012-09-06/2809604-12-c-interview-questions]1、gets()函數:函數gets()從stdin接收一個字串而不檢查它所複製的緩衝的容積,這可能會導致緩衝溢出,推薦使用標準函數fgets()代替。2、換行:window作業系統下的換行為'\r\n',linux和unix作業系統下為'\n'3、strcpy()函數:使用strcpy()的時候一定要檢查接收變數的容量是否足夠,推薦使用str