C Standard Library:
http://www.utas.edu.au/infosys/info/documentation/C/CStdLib.html
裡面包含了C99才加入的lib,不過說明比較少,平常用的話,我比較喜歡 Eric Huss 1997年寫的
The C Reference Guide:
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
雖然是比較舊的版本,但是說明比較詳細,有些還會附範例,我直接存到電腦裡,要寫的時候直接開起來看。
FAQ:
http://c-faq.com/
Infrequently Asked Question:
http://www.plethora.net/~seebs/faqs/c-iaq.html
裡面有些問題還挺有趣的,平時不會想到,有空可以研究研究。
2007年7月24日 星期二
2007年7月11日 星期三
Uniform Server
Introduction:
The Uniform Server is a WAMP package that allows you to run a server on any MS Windows OS based computer. It is small and mobile to download or move around and can also be used or setup as a production/live server. Developers also use The Uniform Server to test their applications made with either PHP, MySQL, Perl, or the Apache HTTPd Server.
官方網站
文件
目前最新版本:Uniform Server 3.5-Apollo
安裝後,phpmyadmin沒辦法使用,說啥
7/16
知道問題出在哪邊了:之前自己安裝php和mysql的時候,把libmysql.dll自己複製到C:\windows下面,砍掉以後就一切正常,不然php根本沒辦法支援mysql...
以前還寫啥教學文章,現在看看真是膚淺...
The Uniform Server is a WAMP package that allows you to run a server on any MS Windows OS based computer. It is small and mobile to download or move around and can also be used or setup as a production/live server. Developers also use The Uniform Server to test their applications made with either PHP, MySQL, Perl, or the Apache HTTPd Server.
官方網站
文件
目前最新版本:Uniform Server 3.5-Apollo
安裝後,phpmyadmin沒辦法使用,說啥
Cannot load mysqli extension. Please check your PHP configuration.找了一堆討論看不出重點,就不管了,反正用console可以連的上就好,順便練習SQL語言,console連線方法在文件裡有講到。
7/16
知道問題出在哪邊了:之前自己安裝php和mysql的時候,把libmysql.dll自己複製到C:\windows下面,砍掉以後就一切正常,不然php根本沒辦法支援mysql...
以前還寫啥教學文章,現在看看真是膚淺...
2007年6月29日 星期五
vim 設定
~/.vimrc
1 :syntax on
2 :set cindent
3 :set autoindent
4 :set nu
5 :set fdm=indent
在家裡因為螢幕比較小,一般tab是8個空白字元,可能沒幾個迴圈就必須縮行,這時可以設定按tab鍵是送出自己設定的空白字元數,這樣就算以後別的編輯器要開啟這個檔案也不會有問題
:set shiftwidth=4
:set softtabstop=4
參考資料:
www.study-area.org/tips/vim/Vim-9.html
1 :syntax on
2 :set cindent
3 :set autoindent
4 :set nu
5 :set fdm=indent
在家裡因為螢幕比較小,一般tab是8個空白字元,可能沒幾個迴圈就必須縮行,這時可以設定按tab鍵是送出自己設定的空白字元數,這樣就算以後別的編輯器要開啟這個檔案也不會有問題
:set shiftwidth=4
:set softtabstop=4
參考資料:
www.study-area.org/tips/vim/Vim-9.html
2007年6月17日 星期日
Cygwin安裝OpenSSH
Cygwin安裝:
Admin:cygrunsrv
Net:openssh
進入Cygwin shell:
ssh-host-config
讓sshd服務不隨開機而啟動:
執行-> services.msc -> 找到 CYGWIN sshd -> 設定為手動啟動
手動開啟:
cygrunsrv -S sshd
參考網址:
cha.homeip.net/blog/archives/2006/04/_winxp_cygwin_s.html
Admin:cygrunsrv
Net:openssh
進入Cygwin shell:
ssh-host-config
Should privilege separation be used? (yes/no) yes
Warning: The following function requires administrator privileges!
Should this script create a local user 'sshd' on this machine? (yes/no) yes
Do you want to install sshd as service?
(Say "no" if it's already installed as service) (yes/no) yes
Which value should the environment variable CYGWIN have when
sshd starts? It's recommended to set at least "ntsec" to be
able to change user context without password.
Default is "ntsec". CYGWIN= 按下Enter接受預設
讓sshd服務不隨開機而啟動:
執行-> services.msc -> 找到 CYGWIN sshd -> 設定為手動啟動
手動開啟:
cygrunsrv -S sshd
參考網址:
cha.homeip.net/blog/archives/2006/04/_winxp_cygwin_s.html
2007年6月8日 星期五
qsort與struct指標運用
- qsort是stdlib.h裡所包含的一個函式,宣告方式請看參考資料一,qsort需要傳入四個參數,值得一提的是第三和第四個參數,第三個參數是資料型態的大小,可以用sizeof()傳進去比較好,不必手算,第四個參數是比較的函式,要求宣告方式為 int compare
(const void *,const void *),傳進的參數必須為void型態,且為const,其他程式無法修改,因此必須在傳進compare後另外宣告兩個原本型態之指標 a與b,再將參數強制轉型指定給 a和b 才能使用,可以看下面的範例程式碼與參考資料中的"函數當作函數的參數"會比較容易瞭解 - 若宣告一個 struct abc後,想存取其中的元素時,必須用"."運算子,但如果是 struct 的指標的話,則必須使用"->"來存取裡面的元素,請看參考資料中的pointer
#include <stdlib.h>
int cmplength(const void *pa,const void *pb);
/*宣告cmplength()*/
struct dics{
char word[26];
int order;
int neworder;
}dictionary[10000];
/*定義srtuct dics並宣告dictionary[10000]為 dic 型態*/
int main(){
qsort(dictionary,N,sizeof(struct dics),cmplength);
return 0;
}
/*呼叫qsort*/
int cmplength(const void *pa,const void *pb){
int la,lb,result;
struct dics *a=(struct dics *)pa;
struct dics *b=(struct dics *)pb;
la=strlen(a->word);
lb=strlen(b->word);
if(la < lb ){
return -1;
}
else{
return 1;
}
}
參考資料:
The Clibrary Reference Guide :
qsort-
www.acm.uiuc.edu/webmonkeys/book/c_guide/2.13.html#qsort
pointer-
www.acm.uiuc.edu/webmonkeys/book/c_guide/1.4.html
函數當作函數的參數:
libai.math.ncu.edu.tw/bcc16/C/C/d0.shtml
訂閱:
意見 (Atom)

