Time of Update: 2018-12-04
自己在csdn註冊帳號也已經兩年多了,不過一直很少來這裡逛,來也是去水區灌水,從去年7月(05年7月)開始,開始來這裡多了,也開始幫人家解決一下問題。 小弟雖不才+愚笨,但是還是靠自己微薄的一些經驗,幫一些比俺更菜的人,解決了一些簡單小問題,從中也學到了不少,所以決定開通自己的部落格,把自己的一些經驗寫出來,一來,便於自己查詢,收藏,便於以後使用,同時也能使自己的經驗和別人共用。 希望大家對我的部落格提出寶貴的意見,使我們一起成長~~
Time of Update: 2018-12-04
#include <iostream>#include <string>using namespace std;#define MAX 105int map[MAX];void add(string s){for(int i = 0; i < s.size(); ++i){map[i] += s[s.size()-i-1]-'0';if(map[i] >= 10){map[i] -= 10;map[i+1]++;}}}int main(){string
Time of Update: 2018-12-04
map<char, int> opt;double cal(double lv, double rv, char op) {switch (op) {case '+': return lv + rv;case '-': return lv - rv;case '*': return lv * rv;case '/': return lv / rv;}assert(0);}double exp_cal(const string &str) {int sz = str.size(
Time of Update: 2018-12-04
int goo(int a, int b){return a + b;}void foo(){int a[] = {1, 2, 3};int result = goo(a[1], a[2]);printf("result: %d", result);}VS2010下編譯foo函數部分彙編:00EB3890 push ebp 00EB3891 mov ebp,esp 00EB3893 sub esp,0E4h 00EB3899 push
Time of Update: 2018-12-04
字串函數:● ASCII('a')=97---返回字母a對應的ASCII碼● CHAR('48')=0---返回48這個ASCII碼對應的字元● LCASE('ABcdE')="abced" 或 LOWER('ABcdE')="abced"(將給定字串轉為小寫)● UCASE('ABcdE')="ABCDE" 或 UPPER('ABcdE')="ABCDE"(將給定字串轉為大寫)● LTRIM(' fgf gh ')="fgf gh "(去掉給定字串左邊的空格)● RTRIM('
Time of Update: 2018-12-04
/*//很很很經典的bfs, 這也是我第一次正式用bfs來刷題,
Time of Update: 2018-12-04
有多個非常相似的函數,只是參數的第2唯長度不一樣,如:void F(int a[][10],int b[][10]){}void F1(int a[][20],int b[][20]){}用函數模板來實現,template <size_t len> void TF(int aa[][len],int bb[][len])看似沒有問題,但是編譯的時候會報錯error C2087: '<Unknown>' : missing
Time of Update: 2018-12-04
1.列舉所有的任務調用EnumWindows這個函數BOOL EnumWindows( WNDENUMPROC lpEnumFunc, // callback function LPARAM lParam // application-defined
Time of Update: 2018-12-04
在SDK,進行windows程式設計(不使用mfc),使用這些控制項,要進行一些必要的初試化,否則如果在對話方塊上畫這些控制項,對話方塊就不能正常顯示 先說Rich Edit控制項,這個是個特例。 如果往對話方塊裡添加了一個Rich Edit控制項,然後運行程式.理應彈出對話方塊,但是沒有彈出.如果把Rich Edit
Time of Update: 2018-12-04
1.枚舉所有的進程方法很多,這裡用EnumProcesses這個方法DWORD aProcesses[1024], cbNeeded, cProcesses; unsigned int i;if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) ) return; cProcesses = cbNeeded / sizeof(DWORD); for ( i = 0; i <
Time of Update: 2018-12-04
ListCtrl在工作中,常常用到,也常常看到大家發帖問怎麼用這個控制項,故總結了一下自己的使用經驗,以供參考使用。 先註明一下,這裡,我們用m_listctrl來表示一個CListCtrl的類對象,然後這裡我們的ListCtrl都是report形式,至於其他的如什麼大表徵圖,小表徵圖的暫時不講,畢竟report是福士話的使用。其次,我們這裡用條款一,條款二來描述第一點,第二點,這個是參照《Effective C++》的叫法,俺覺得這麼叫比較COOL
Time of Update: 2018-12-04
1.擷取所有的磁碟機利用函數GetLogicalDriveStringsThe GetLogicalDriveStrings function fills a buffer with strings that specify valid drives in the system. DWORD GetLogicalDriveStrings( DWORD nBufferLength, // size of buffer LPTSTR lpBuffer // drive
Time of Update: 2018-12-04
#include <iostream>using namespace std;__int64 q[1100000];int n;__int64 bfs(){int front = 0, rear = 0;q[rear++] = 1;while(front < rear){__int64 temp = q[front++];if(temp % n == 0)return temp;temp *= 10;q[rear++] = temp;q[rear++] =
Time of Update: 2018-12-04
整理了一些以前回答的文章,話先說在前面,比較適合初學者!! 問題1: Linking... nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex libcd.lib(crt0.obj) :
Time of Update: 2018-12-04
其實方法很多的,這裡列出幾個比較常見的方法來,這裡是以SDI的架構視窗為例子來實驗的。1.建立一個最大化的視窗,並且不能改變其大小那麼首先, app的InitInstance中 在原來pMainFrame->ShowWindow(m_nCmdShow); 的前面加上 DWORD dwStyle = GetWindowLongm_pMainWnd->m_hWnd, GWL_STYLE); //
Time of Update: 2018-12-04
#include <iostream>#include <string>#include <algorithm>using namespace std;int hash1[26];int hash2[26];int main(){string s1, s2;cin >> s1 >> s2;for(unsigned int i = 0; i < s1.size();
Time of Update: 2018-12-04
類繼承中建構函式和解構函式的調用現在,有三個類,類的定義如下class CA{public: CA(){cout<<"CA constructor"<<endl;} ~CA(){cout<<"CA desstructor"<<endl;}};class CB:public CA{public: CB(){cout<<"CB constructor"<<endl;} ~CB(){cout<<"CB
Time of Update: 2018-12-04
上班閑來無事,上網灌水累了,於是決定self study一會,找了一份公司的資料庫培訓資料,翻翻看看 翻到join查詢一塊,突然想起以前開發時,碰到的一個左串連的問題,於是,在CSDN尋找舊貼,整理了一下. 我們在查詢的時候,有三種join類型:內串連、外串連和交叉串連。 內串連(INNER JOIN)使用比較子進行表間某(些)列資料的比較操作,並列出這些表中與串連條件相匹配的資料行。根據所使用的比較方式不同,內串連又分為等值串連、自然串連和不等串連三種。 外串連分為左外串連(LEFT
Time of Update: 2018-12-04
#include <iostream>using namespace std;int Lowbit(int t){//t後零的個數為k,返回2^k return t & ( t ^ ( t - 1 ) );}int main(){int n;int node;scanf("%d", &n);while(n--){scanf("%d", &node);int v = Lowbit(node)-1;printf("%d %d/n", node-v,
Time of Update: 2018-12-04
開發環境是VS2005 ,資料庫是SQL Sever 20001. 在進入正題之前,先講點別的,如何在VC中串連Sybase資料庫, 串連字元竄為, _bstr_t strCnn("Driver={Sybase System 11};Srvr=RRRRR;Uid=RRR_Mao_bb1;Pwd=user2");這裡,RRRRR是資料庫的名稱,已經在Sybase->sdedit中設定好了 RRR_Mao_bb1 和