I'm looking a while for a decent piece of code to use in my app, in one of those algorithms. I found this example: http://rosettacode.org/wiki/K-d_tree#C But when I put the code in xcode, I get an errors, for example:
"use of undeclared identifier", "expected ';' at the end of declaration". I guess a header file is missing?
I copied the code from the link and made a minor edit which moved "swap" from being an inline nested function to a static function. Compiled with "gcc -C99 file.c" and it compiled ok. So, no, it doesn't need some include file. Maybe you mis pasted it.
If you are happy with this answer, you could accept it. Thanks.