centos下Linux C語言MD5的使用

2022-05-10 14:30:19 字數 531 閱讀 4734

在linux c變成中用到md5加密會使用到openssl庫,下面給出的是乙個簡單的小demo:

#include #include 

#include

#define md5_length 16

#define max 40

int main(void

) fprintf(stderr,

"%s\n

", buf);

return0;

}

這裡如果在進行編譯時出現 error: openssl/md5.h no such file or directory說明目前沒有安裝openssl的開發包,那需要安裝一下該安裝包:

使用yum install openssl-devel 即可完成安裝。

如果在編譯時出現undefined reference to `md5_init'是因為在編譯時需要鏈結openssl庫的內容,在編譯時加上-lssl就ok了。

Linux C語言操作Mysql

rpm ivh 安裝 i 安裝,v 顯示進度,h列印 表示進度 var lib mysql 日誌檔案,資料庫檔案存放目錄 usr lib mysql 介面函式動態連線庫存放目錄 usr include sql 介面函式庫檔案頭存放目錄 啟動mysql service mysql start 停止my...

Linux C語言檔案讀寫

include include include include include include void main int fd,size char s hello world buffer 200 開啟 home yyf desktop linux 做寫入,如果該檔案不存在則建立該檔案 引數o w...

Linux C語言結構體

1.展開標頭檔案 作用 2.進行巨集替換 字串替換 3.預處理階段不考慮c的語法的 下面這句經過處理後 i檔案 tni不會被替換成int的。typedef int tni typedef int p p q null 等同於int q null typedef 有乙個作用域。2.結構體初始化和引用 ...