searching in the file

hello every body , if we suppose that i have a file in c++ . in this file a lot of names and in front of each name its ID . my problem is how to search in the file by ID
and when i search by ID , it must be appeared the name of this ID . ??????
Last edited on
Model the data into a type, load the data into memory via a container of objects, and perform the searches. A std::map<int, string> or similar might be a good start.
Topic archived. No new replies allowed.