共 5 篇文章 |
|
0、获取字符串长度:int strlen(char *s)7、字符串复制:strcpy函数、strncpy函数、strdup函数(1)char *strcpy(char *dest, const char *src)函数说明:将src字符串到内容拷贝到dest指向到字符串中,注:拷贝的长度由src字符串的''\0''空字符的位置决定,因此使用到时候要考虑到src末尾是否有空字符,并且考虑dest字符串的大小,... 阅6103 转13 评0 公众公开 12-03-09 15:28 |
ubuntu下编译和使用libxml2ubuntu下编译和使用libxml2安装:#sudo apt-get install libxml2#sudo apt-get install libxml2-dev 安装成功后:所有的头文件在/usr/include/libxml2/这个文件目录下,lib文件在/usr/lib在这个下面。xmlNewChild(root_node, NULL, BAD_CAST "node1",BAD_CAST "content of node1");node=xmlNewCh... 阅3048 转13 评0 公众公开 12-02-23 15:36 |
} n = bind(sock_fd, (struct sockaddr *)&sin, sizeof(sin));}int main(void){struct sockaddr_in sin;} /*Client.c by ksir in 2011-10-14*/#include<stdio.h>#include<string.h>#include<stdlib.h>#include<sys/types.h>#include<unistd.h>#include<sys/socket.h>#include<linux/in.h>#inclu... 阅1088 转8 评0 公众公开 12-02-20 14:38 |
linux c xml 读写linux c xml 读写。node=xmlNewChild(root_node, NULL, BAD_CAST "node3", BAD_CAST"node has attributes");生成的xml:[denny@localhost xml]$ gcc -I/usr/include/libxml2/ -lxml2 tree1.c[denny@localhost xml]$ ./a.out<?xml version="1.0" encoding="UTF-8"?><root>&... 阅2031 转12 评0 公众公开 12-02-20 14:33 |
fgets函数fgets函数。fgets函数用来从文件中读入字符串。fgets(由文件中读取一字符串,也可以从屏幕上输入一字符串,见范例。)相关函数open,fread,fscanf,getc表头文件include<stdio.h>定义函数char * fgets(char * s,int size,FILE * stream);函数说明fgets()用来从参数stream所指的文件内读入字符并存到参数s所指的内存空间,直到... 阅316 转0 评0 公众公开 12-02-20 11:53 |