On 16 Nov 08, at 23:38, Oleg Krupnov wrote:
I apologize, this is plain old C, not Cocoa-specific question, but the
fastest way to get the answer.
I want to create a function that finds the minimum out of a
variable-length list of simple float arguments. In other words, I want
this function:
float min(float x, ...);
Can anyone suggest the implementation?
It's not possible. There's no way to determine the length of an
argument list - you need either a delimiter, or an extra argument to
signal the number of arguments.
See 'man stdarg' for what you've got, and what it can do.
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]