Question: Read nameOffile and three strings from input. Open nameOffile as an output fle. If the file fails to open, use cout to output nameOffile followed

 Read nameOffile and three strings from input. Open nameOffile as an
output fle. If the file fails to open, use cout to output

Read nameOffile and three strings from input. Open nameOffile as an output fle. If the file fails to open, use cout to output nameOffile followed by ". error occurred while opening file,", and do not proceed to the code that writes to the file, Otherwise, for each string read, write "-followed by the string to the opened file. End each output with a newline and close the file. Ex: If the input is output. txt Rabia Dan Asha, then output txt contains: - Rabia - Dan - Asha - Rabia - Dan - Asha using namespoce sta; int main( ) ofstream guest NamesFS; string name0ffile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!