c语言函数调用问题
各位大佬,我太久不用c了,有点疑惑像下面这个调用compare_bt_lefts
不需要加参数调用吗?像这样:compare_bt_lefts(a,b);
是因为都是const吗?
qsort(selected_detections, selected_detections_num, sizeof(*selected_detections), compare_by_lefts);
int compare_by_lefts(const void *a_ptr, const void *b_ptr) {
const detection_with_class* a = (detection_with_class*)a_ptr;
const detection_with_class* b = (detection_with_class*)b_ptr;
const float delta = (a->det.bbox.x - a->det.bbox.w/2) - (b->det.bbox.x - b->det.bbox.w/2);
return delta < 0 ? -1 : delta > 0 ? 1 : 0;
} 这是传了个函数,不是传的函数返回值
这是函数传值 楼上正解 永恒的蓝色梦想 发表于 2020-5-24 16:55
这是传了个函数,不是传的函数返回值
谢谢!
页:
[1]