易截截图软件、单文件、免安装、纯绿色、仅160KB

ACM c函数大全

函数名: abs 功  能: 求整数的绝对值
用  法: int abs(int i);
程序例:
#include <stdio.h>
#include <math.h>
int main(void)
{
  int number = -1234;
  printf("number: %d  absolute value: %d\n", number, abs(number));
  return 0;
}
函数名: atof
功  能: 把字符串转换成浮点数
用  法: double atof(const char *nptr);
程序例:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
   float f;
   char *str = "12345.67";
   f = atof(str);
   printf("string = %s float = %f\n", str, f);
   return 0;
}
函数名: atoi
功  能: 把字符串转换成长整型数
用  法: int atoi(const char *nptr);
程序例:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
   int n;
   char *str = "12345.67";
   n = atoi(str);
   printf("string = %s integer = %d\n", str, n);
   return 0;
}
函数名: atol
功  能: 把字符串转换成长整型数
用  法: long atol(const char *nptr);
程序例:
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
   long l;
   char *str = "98765432";
   l = atol(lstr);
   printf("string = %s integer = %ld\n", str, l);
   return(0);
}
函数名: bsearch
功  能: 二分法搜索
用  法: void *bsearch(const void *key, const void *base, size_t *nelem,  size_t width, int(*fcmp)(const void *, const *));
程序例:
#include <stdlib.h>
#include <stdio.h>
#define NELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
int numarray[] = {123, 145, 512, 627, 800, 933};
int numeric (const int *p1, const int *p2)
{
   return(*p1 - *p2);
}
int lookup(int key)
{
   int *itemptr;
   /* The cast of (int(*)(const void *,const void*))
      is needed to avoid a type mismatch error at
      compile time */
 &


相关文档:

使用LR录制C/S应用程序(工作过程记录)

日志记录了正式执行测试之前的整个工作过程(以失败经验为主),其中包括:测试方案的制定,方案的可执行性验证,以及方案执行失败后的修改与完善。此次工作为“性能测试”范畴,这个方向也是我的技术短板之一。坦白的讲,以我个人的能力几乎不能做到,之所以解决方案能够通过,在此主要感谢开发同事的全力支持和 ......

浅谈C/C++内存泄漏及其检测工具

  对于一个c/c++程序员来说,内存泄漏是一个常见的也是令人头疼的问题。已经有许多技术被研究出来以应对这个问题,比如Smart Pointer,Garbage Collection等。Smart Pointer技术比较成熟,STL中已经包含支持Smart Pointer的class,但是它的使用似乎并不广泛,而且它也不能解决所有的问题;Garbage Collection技术在Java中 ......

简述C和C++的学习历程(转肖舸老师)

总是被同学们问到,如何学习C和C++才不茫然,才不是乱学,想了一下,这里给出一个总的回复。
一家之言,欢迎拍砖哈。
1、可以考虑先学习C。
大多数时候,我们学习语言的目的,不是为了成为一个语言专家,而是希望成为一个解决问题的专家。做一个有用的程序员,做一个赚钱的程序员。我们的价值,将体现在客户价值上,而不 ......

c/c++头文件,保存,备用

 
C、传统 C++
#include <stdio.h>     //定义输入/输出函数
#include <stdlib.h>    //定义杂项函数及内存分配函数
#include <string.h>    //字符串处理
#include <assert.h>    //设定插入点
#include <ctype.h>     //字符处理
#include <errno.h&g ......

c标准

developerWorks 中国 > Linux > 用 C99 进行开放源代码的开发您的 C 代码符合标准吗? 文档选项 打印本页 将此页作为电子邮件发送 级别: 初级 Peter Seebach (developerworks@seebs.plethora.net), 自由作家 2004 年 4 月 01 日 C99 是什么?谁需要它?它可用了吗?Poter Seebach 讨论了 ISO C 标准的 1999 年修订版 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号