社区
新手乐园
帖子详情
请问C语言的库函数里有compare函数么?
yinglongyxy
2007-03-25 10:18:06
这几天开始学习数据结构的顺序表,书中定义了一个操作:
int LocateElem(SqList L,ElemType e,Status(*compare)(ElemType,ElemType))
但我不知道compare是什么函数,如果不是库函数,需要自己定义么?在网上查阅了一些库函数大全也没找到,望高手指教。
谢谢!!
...全文
1756
5
打赏
收藏
请问C语言的库函数里有compare函数么?
这几天开始学习数据结构的顺序表,书中定义了一个操作: int LocateElem(SqList L,ElemType e,Status(*compare)(ElemType,ElemType)) 但我不知道compare是什么函数,如果不是库函数,需要自己定义么?在网上查阅了一些库函数大全也没找到,望高手指教。 谢谢!!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
lei001
2007-03-25
打赏
举报
回复
可以考虑使用memcmp函数
iu_81
2007-03-25
打赏
举报
回复
C++String类里的compare
=======================
C里的strcmp()
iu_81
2007-03-25
打赏
举报
回复
string里面的函数
yinglongyxy
2007-03-25
打赏
举报
回复
哦
楼上说得对
珍惜生命远离CPP
2007-03-25
打赏
举报
回复
1
int LocateElem(SqList L,ElemType e,Status(*compare)(ElemType,ElemType))
中compare是一个参数的名字,类型为函数指针。
c/c++
函数
库
说明(api)html版
所有的 C / C++
函数
Constructors (cppstring) Constructors (cppvector) Operators (cppbitset) Operators (cppdeque) Operators (cppstack) Operators (cppstring) Operators (cppvector) abort (stdother) abs (stdmath) acos (stdmath) any (cppbitset) append (cppstring) asctime (stddate) asin (stdmath) assert (stdother) assign (cppdeque) assign (cpplist) assign (cppstring) assign (cppvector) at (cppdeque) at (cppstring) at (cppvector) atan (stdmath) atan2 (stdmath) atexit (stdother) atof (stdstring) atoi (stdstring) atol (stdstring) back (cppdeque) back (cpplist) back (cppqueue) back (cppvector) bad (cppio) begin (cppdeque) begin (cpplist) begin (cppmap) begin (cppmultimap) begin (cppmultiset) begin (cppset) begin (cppstring) begin (cppvector) bsearch (stdother) c_str (cppstring) calloc (stdmem) capacity (cppstring) capacity (cppvector) ceil (stdmath) clear (cppdeque) clear (cppio) clear (cpplist) clear (cppmap) clear (cppmultimap) clear (cppmultiset) clear (cppset) clear (cppvector) clearerr (stdio) clock (stddate)
compare
(cppstring) copy (cppstring) cos (stdmath) cosh (stdmath) count (cppbitset) count (cppmap) count (cppmultimap) count (cppmultiset) count (cppset) ctime (stddate) data (cppstring) #define (preproc) difftime (stddate) div (stdmath) empty (cppdeque) empty (cpplist) empty (cppmap) empty (cppmultimap) empty (cppmultiset) empty (cpppriorityqueue) empty (cppqueue) empty (cppset) empty (cppstack) empty (cppstring) empty (cppvector) end (cppdeque) end (cpplist) end (cppmap) end (cppmultimap) end (cppmultiset) end (cppset) end (cppstring) end (cppvector) eof (cppio) equal_range (cppmap) equal_range (cppmultimap) equal_range (cppmultiset) equal_range (cppset) erase (cppdeque) erase (cpplist) erase (cppmap) erase (cppmultimap) erase (cppmultiset) erase (cppset) erase (cppstring) erase (cppvector) #error (preproc) exit (stdother) exp (stdmath) fabs (stdmath) fail (cppio)
C
语言
库
函数
常用
函数
名称及其用途
文章目录 1.数学
函数
(#include <math.h> 或 #include “math.h”) 2.字符
函数
和字符串
函数
(#include <string.h> 或 #include “string.h”) 3.输入输出
函数
4.动态存储分配
函数
数学
函数
...
c
语言
实现
库
函数
目录 一.strlen
函数
1.描述 2.实现 1.计数的方法 2.
函数
递归的方法 3.指针 - 指针方法 二.strcmp
函数
1.描述 2.实现 三.strcpy
函数
的实现 1.描述 2.实现 四.strcat
函数
的实现 1.描述 2.实现 五.strstr
函数
的实现 1.描述 2.实现 1.BF算法实现 2.kmp算法的实现 一.strlen
函数
1.描述 C
库
函数
size_t strlen(const char *str) 计算字符串 .
C
语言
search
函数
的作用,C
语言
中
库
函数
自带的查找
函数
bsearch
之前查看qsort
函数
的时候无意间看到了一个C
语言
内置的查找
函数
bsearch.#include void *bsearch( const void *key, const void *buf, size_t num, size_t size, int (*
compare
)(const void *, const void *) );功能:
函数
用折半查找法在从数组元素buf[0]到buf[num-...
C
语言
库
函数
大全及应用实例八
原文:C
语言
库
函数
大全及应用实例八 [编程资料]C
语言
库
函数
大全及应用实例八
函数
名: kbhit 功 能: 检查当前按下的键 用 法: int kbhit(void); 程序例: #i nclude int main(void) { cprintf("Press any key to conti...
新手乐园
33,311
社区成员
41,784
社区内容
发帖
与我相关
我的任务
新手乐园
C/C++ 新手乐园
复制链接
扫一扫
分享
社区描述
C/C++ 新手乐园
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章