Hi everybody I am a beginner with C++ programming. And I need some help.
How can I start with this program
You can first start by showing some effort . It's fine if you need help with a specific item, but don't post the entire assignment expecting us to write it for you. If you've written any code, post it here.
Starting any program requires you to give much thought before even coding a single line. First of all plan what the program is actually going to do, and perhaps use flow charts to help visualize the process. Once you've got the basic idea, write a simple pseduocode program that uses these ideas. Converting this pseudocode to an actual programming language is trivial, especially if you've thought it through carefully.
Reading files in C++, of course, uses ifstream . Use the member function open() to open the file you plan to read, and then check the success of opening the file with good() . You can then read from the stream with the regular stream operators, and you can use the member function eof() to determine when you're at the end of a file. And then to be good and proper, use close() to finish off.
Writing files in C++ uses ofstream . Again, use the open() member function to open a file for writing. If the file named doesn't exist, a new file will be created. Use good() to check for success on opening, and close() when you're finished.
Hope this helps