delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/23/03:30:33

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Function Pointers with Classes and QSORT
Date: Mon, 23 Feb 1998 00:12:53 -0800
Organization: Alcyone Systems
Lines: 19
Message-ID: <34F12F85.2A3BCFB3@alcyone.com>
References: <34F0F322 DOT 4133902E AT earthlink DOT net> <34F125EC DOT EB2DEC03 AT LSTM DOT Ruhr-UNI-Bochum DOT De>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thomas Demmer wrote:

> I am not sure if this can work at all. I believe every class
> member function has a hidden parameter, the "this"-variable.
> And as qsort() as a normal C function doesn't know anything
> about classes, this will probably always fail.

qsort requires function pointers, and the names of member functions are
member function pointers, not function pointers.  One can use static
member functions as the contents of a normal C-style member function
pointer, though.

-- 
         Erik Max Francis, &tSftDotIotE / mailto:max AT alcyone DOT com
                       Alcyone Systems / http://www.alcyone.com/max/
  San Jose, California, United States / icbm://+37.20.07/-121.53.38
                                     \
        "I've got the fever for the / flavor of a cracker"
                                   / Ice Cube

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019