Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NE1 know about _lfind ? or searching an array ??

Status
Not open for further replies.

skinah

Programmer
Oct 3, 2001
17
AU
I need some help searching an array for a key. I believe that _lfind can do what I want but I dont understand the compare parameter. Why do you need to write a compare function for the command to work and how do you go about writing a simple function to find one string in another string.

At the moment I use this line....

result = (char **)_lfind( &key, ChInfContents, &lengthofcontents,1,NULL);

but it gives me an unhandled exception....access violation

the contents of a INF file is in ChInfContents and the key pointer has the search string in it eg... "hello" I wish to search the ChInfContents[] for "hello"

If anyone can help I'd appeaciate it heaps.

Matt
 
please help i cant figure it out. I'm sure that theres lots of really good c++ programmers here that will know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top