Question: C++ can you create for me a void function of write file with vector reference thank you 1. write_file(vector & &v): (1) Open file for
1. write_file(vector & \&v): (1) Open file for writing (2) check if file can be open for writing (due to memory problems) (3) Prompt user to enter student records. NOTE: number of records is unknown, so program must repeatedly prompt user for input until the user enters "quit". To make this work, extract only the first word from standard input stream buffer (this would be the student's last name) and check it is "quit". (4) Extract the rest of the values from standard input stream: first name, student id, and gpa. (5) use DO-WHILE loop to get user input (6) use output string stream to write to the CSV file (7) NOTE: you should also insert record number to before the student record (figure out how to do that). (8) Add student record to the vector passed in by reference (meaning that the function will modify the original vector) (9) close file when user enters "quit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
