|
>> Are pointers necessary for performing a binary search? No, not really. Not even if you use the C run-time function bsearch, if you code it properly. I can't see how - unless you code a separate prototype each time you use it, which kind of goes against the point of protos. It expects a pointer and I can only give it that by specifying a field by reference (in which case at least the basic array type has to match) or a pointer. Am I missing something? Of course if I didn't understand pointers, I wouldn't know how to code it "properly" anyway <vbg> >> The new built-in function %LOOKUP uses a binary search algorithm when used with ordered arrays. Agreed, but unless you are also implementing arrays with a variable numbers of entries _and_ no practical maximum on the number of elements _and_ the ability to search not just arrays but MODS as well then I would still have a problem. Most of the recent situations that we have been involved in required one or more of these characteristics. As to your comments on not using pointers in a high-level language - I basically agree with you - providing the language offers all the facilities that I need for application programming. RPG IV still doesn't. Admittedly, now that I get the C compiler as part of the development tools, I am more likely to use "the right tool for the job" - but on earlier releases it wasn't practical to pay big bucks for a compiler that you needed three times a year. Jon Paris Partner400
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.