標題: 函數(shù)庫學習筆記。。。。。 [打印本頁]

作者: hongniu    時間: 2015-6-24 21:20
標題: 函數(shù)庫學習筆記。。。。。
  1.                                                                                                  include<math.h>
  2. int abs (int val);       取整形絕對值函數(shù) ;
  3. float fabs (float val);  取浮點型數(shù)字絕對值函數(shù);
  4. long labs (long val);    取長整形絕對值函數(shù) ;
  5. char cabs (char val);    取字符形絕對值函數(shù) ;
  6. float atan2 (float y,float x); 求X/Y的arctangent值;
  7. float atan (float x);。。。。。
  8. float acos (float x);。。。。。
  9. float asin (float x);。。。。。
  10. float atof (void *string);把字符串轉(zhuǎn)換成浮點型值"1.23"->1.23,f代表float;
  11. int atoi;。。。。。。。。。"123"->123;
  12. long atol;。。。。。。。。。"6556523"->6556523;
  13. void *memccpy (void *dest,   /* destination buffer        */
  14.                void *src,    /* source buffer             */
  15.                char c,       /* character which ends copy */
  16.                int len);     /* maximum bytes to copy     */將一個字符串拷貝到另一個字符串中直到考完字符c或者len的長度為止
  17. char memcmp (void *buf1,   /* first buffer             */
  18.              void *buf2,   /* second buffer            */
  19.              int len);     /* maximum bytes to compare */比較兩個字符串的大小,buf1>buf2返回1.........
  20. void *memchr (void *buf,  /* buffer to search      */
  21.               char c,     /* byte to find          */
  22.               int len);   /* maximum buffer length */在字符串中的前l(fā)en個字符中查詢字符c,并返回該字符指針
  23. #include <stdlib.h>
  24. void *calloc (unsigned int num,    /* number of items     */
  25.               unsigned int len);創(chuàng)建一個含有num個長度為len的元素陣列,
  26. void free (void xdata *p);釋放指針函數(shù)
  27. void init_mempool (void xdata *p,        /* start of memory pool  */
  28.                    unsigned int size);   /* length of memory pool */創(chuàng)建一塊內(nèi)存區(qū)以便使用
  29. void *realloc (void xdata *p,        /* previously allocated block */
  30.                unsigned int size);   /* new size for block         */將已經(jīng)創(chuàng)建的內(nèi)存擴大到新的size,但沒有足夠的內(nèi)存擴大時該函數(shù)失效
  31. void *malloc (unsigned int size);    /* block size to allocate */創(chuàng)建一段長度為size的內(nèi)存使用
  32. float ceil (float val);計算出val數(shù)字的最小的不小于該數(shù)的整數(shù),但類型仍為float型
  33. float floor (float val); 和上面的相反,最大的不大于該書的整數(shù)                                                                                                                    
復制代碼







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1