how does a "const void * foo (param, param)" function work?

1

bool cmp(const void * a, const void * b) {
  return static_cast < /*type?*/ * > a < static_cast < /*type?*/ * > b;
}

const void * min(const void * first, const void * last, size_t size, compare cmp) {
  void * minor = * first;
  while (first != last) {
    if (cmp(first, first++)) {
      * minor = * first;
    }

    * first++;
  }
}

I'm trying to make a function that output is the first occurrence of the least element, and the function's prototype is

const void * min(const void * first, const void * last, size_t size, Compare cmp);

I need to program the cmp function that returns true if < b and the prototype must be

bool cml ( const void * a, const void * b);

obs: the code has to be done in c ++

    
asked by anonymous 27.09.2018 / 19:49

0 answers