c标准库部分冷门函数。
stdio.h char buf[256];
sscanf(buf,"%s",&buf);
sprintf(buf,"Name: %s","xxx");
math.h ceil()向下取整,floor()向上取整
time.h 获取系统时间
struct tm * localtime(const time_t *tod); //将“秒”纸转成“年月日时
time_t mktime(struct tm *tptr); //将“年月日时分秒”转成“
time_t time(time_t * tod); //取得当前时间
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_ydat;
}
time_t now=time(0); //获取系统;
/*计数毫秒级时间*/
time_t start = time(NULL);
for(i=0;i<10000;i++)
{
//...
}
time_t end =time(NULL);
int avg =(end-start)/10000;
stdlib.h
double atof(const char *s);
int atoi(const char *s);
int rand(void);
void srand(unsigned int seed);
int system(const char *s);
string.h
memcpy(dst,scr,n);从src复制n个字节到dst, memcmp(a,b,n);比较n个字节的内容。memmove(dst,src,n)移动数据。
文件操作;
FILE *fopen(const char *filename,const char *mode);
int fclose(FILE *stream);
size_t fwrite(const void *buf ,size_t size,size_t nelem,FILE * stream);
size_t fread(const void *buf ,size_t size,size_t nelem,FILE * stream);
fprintf(); fgets();
fseek(fp,n,str); n跳到100个字节,SEEK_SET(跳到第n个位置) SEEK_END(跳到第n个位置)
SEEK_CUR(跳到当前前n个位置) SEEK_CUR(跳到当前后n个位置)
原文:http://www.cnblogs.com/Q1143316492/p/6443261.html