摘要: 1、更详细资料参见http://learn.akae.cn/media/apas03.htmlhttp://www.ibm.com/developerworks/cn/linux/i18n/unicode/linuni/UTF-8 and Unicode FAQ:http://www.linuxforum.net/books/UTF-8-Unicode.html2、部分示例代码#include <stdio.h>#include <locale.h>#include <wchar.h>int main(void){ wchar_t wstr=L"你 阅读全文
posted @ 2011-11-24 15:27 HustQuan 阅读(1286) 评论(0) 推荐(0) 编辑
摘要: 定义FILE *fp; //文件指针、句柄int fd; //文件描述符char pathname[1024]; //文件路径1、pathname --> fp,fdfp = fopen(pathname,"r");fd = open(pathname,O_RDONLY);2、fd --> fp,pathnamefp = fdopen(fd,"r");下面这个函数能够实现由fd转成pathname,int get_pathname_from_fd(int fd, char pathname[], int n){ char buf[1024]; 阅读全文
posted @ 2011-11-24 14:53 HustQuan 阅读(3920) 评论(0) 推荐(0) 编辑
摘要: 1、linux c代码实现#include <netdb.h>#include <stdio.h> #include <stdlib.h>#include <string.h>#include <unistd.h>#include <arpa/inet.h>#include <netinet/in.h>#include <sys/socket.h>typedef enum {false,true}bool;int main() { bool flag; int sock; char **pptr = 阅读全文
posted @ 2011-11-24 14:17 HustQuan 阅读(4042) 评论(0) 推荐(0) 编辑
摘要: 1、安装库libesmtp-develyum install libesmtp-devel或apt-get install libesmtp-devel如果没法用命令安装,就上http://www.stafford.uklinux.net/libesmtp/自己下载包安装。2、不认证即可发信息#define _XOPEN_SOURCE#include <stdio.h>#include <stdlib.h>#include <ctype.h>#include <unistd.h>#include <getopt.h>#include 阅读全文
posted @ 2011-11-24 14:07 HustQuan 阅读(4159) 评论(0) 推荐(0) 编辑