Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to search for a record in a file.

how to search for a record in a file.

Scheduled Pinned Locked Moved C / C++ / MFC
careergraphicsperformancetutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    santhosh padamatinti
    wrote on last edited by
    #1

    Hi, Recently I attempted a interview. There they ask me one question, " You have a file with employee records, with fields empno, emp name and salary. Now you have to retrieve employee information based on the employee name" For this what I answered is, I will write a vector and based on the emp no I will search the records. For this he again ask me what happens when that particular file is in terabytes of memory records. Please can any one knows the approach for retrieve a emprecord from a big file based on the number.... Thanx in advance........

    sampath-padamatinti

    D K 2 3 Replies Last reply
    0
    • S santhosh padamatinti

      Hi, Recently I attempted a interview. There they ask me one question, " You have a file with employee records, with fields empno, emp name and salary. Now you have to retrieve employee information based on the employee name" For this what I answered is, I will write a vector and based on the emp no I will search the records. For this he again ask me what happens when that particular file is in terabytes of memory records. Please can any one knows the approach for retrieve a emprecord from a big file based on the number.... Thanx in advance........

      sampath-padamatinti

      D Offline
      D Offline
      dxlee
      wrote on last edited by
      #2

      One solution is to build an index to the records in the file.

      1 Reply Last reply
      0
      • S santhosh padamatinti

        Hi, Recently I attempted a interview. There they ask me one question, " You have a file with employee records, with fields empno, emp name and salary. Now you have to retrieve employee information based on the employee name" For this what I answered is, I will write a vector and based on the emp no I will search the records. For this he again ask me what happens when that particular file is in terabytes of memory records. Please can any one knows the approach for retrieve a emprecord from a big file based on the number.... Thanx in advance........

        sampath-padamatinti

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        Hasnt the application which had written such file, an API too solve such tasks :confused:

        Press F1 for help or google it. Greetings from Germany

        1 Reply Last reply
        0
        • S santhosh padamatinti

          Hi, Recently I attempted a interview. There they ask me one question, " You have a file with employee records, with fields empno, emp name and salary. Now you have to retrieve employee information based on the employee name" For this what I answered is, I will write a vector and based on the emp no I will search the records. For this he again ask me what happens when that particular file is in terabytes of memory records. Please can any one knows the approach for retrieve a emprecord from a big file based on the number.... Thanx in advance........

          sampath-padamatinti

          2 Offline
          2 Offline
          224917
          wrote on last edited by
          #4

          He may have raised the terabyte issue only because you mentioned about vector. Maybe he was expecting something else - like it is may not be a good idea to search employee information based on name, since there may be duplicates.

          -Suhredayan

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups