Path: utzoo!attcan!uunet!ginosko!brutus.cs.uiuc.edu!apple!zorba!dtynan From: pag@tcsc3b2.tcsc.com (Philip A. Gross) Newsgroups: comp.unix Subject: Re: hsearch() command (HELP!) Message-ID: <3499@zorba.Tynan.COM> Date: 14 Oct 89 22:38:20 GMT References: <3473@zorba.Tynan.COM> Sender: dtynan@zorba.Tynan.COM Organization: The Computer Solution Company, Inc. Lines: 27 Approved: dtynan@zorba.Tynan.COM wacohen@phoenix.princeton.edu (William Alan Cohen) writes: >Hello... I'm not a regular reader of this group but I've got >this problem, see, and I thought maybe someone would like to help. >It's about the hsearch command I found in some documentation. >It's a built-in hash table manager, and I can't figure out how >it handles storage keys... sometimes there are finds where there >shouldn't be, other times it seems to fail to find matches. Does >anyone have any experience with the command and/or know if it >may be buggy on my machine? > Thanks for your time (you read this, no?) > Bill I am not as familiar with the hsearch(3C) functions as well as I am with the tsearch(3C) (binary tree) functions. However, with the use of tsearch, the functions store a pointer to the pointer you give it. So in your comparison/search functions, you should make sure that your are properly dereferencing the pointers. Philip A. Gross The Computer Solution Co., Inc. Voice: 804-794-3491 INTERNET: pag@tcsc3b2.tcsc.com UUCP: tcsc3b2!pag (804)794-1514 The opinions expressed here are strictly mine and nobody elses.