search function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • momotaro
    Contributor
    • Sep 2006
    • 357

    search function

    is there any pre-built function that will look in an array (3D) for a match to key word

    I have created a "data base" for a video club the fields are :

    the title, the type, the hero, and the quatity.

    the search function that am looking for is the one that could look in let say the titles field for a match to a given key
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Hi,
    I think its not there.
    Only pre built search function is bsearch in C.

    Raghu

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      You are in need of multiple indexes.

      Usually this means you will:

      1) create your database. Call this Movies
      2) create a second database where each record is a name plus the pointer to the correct Movies record.
      3) create a third database where each record is the hero plus the pointer to trhe Movies record.

      If you use C++, you can use multimaps for this to allow for duplicate keys where your hero appears in more than one Movie.

      You will need to write databasew control functions to add, replace and delete Movies records do that the other index databases are updated correctly.

      Comment

      Working...