So from what I can gather you have a text file that has a bunch of numbers. What you want to do is take each of these numbers and place them into some container, search the container for some set of numbers, if a match found, delete that from the file?
Ok let's break this into steps:
1) Need to start by knowing thow the numbers are seperated. Newlines, whitespaces, not separated at all but are all one digit?
2) Then you need to load the file
3) Now you need to iterate through this file pulling out each number (we know the format from step 1) and storing it in the container.
4) Does order matter? If not, sort the array real quick. If the order does, leave it alone.
5) Now search the container and remove all numbers that match a given set.
6) Output this container back to the file. You can just overwrite the old file now, though it's wise to tell it to save a backup of that file. On *nix systems, this is denoted with just "file_name.ext~", note the tilde.
To overwite a file, just open an ofstream binded to that file and use the ios::trunc flag.
http://www.cplusplus.com/reference/fstream/ofstream/ofstream/