Which of the following writes the contents of the city variable to an output file named address.txt?

Question:

Which of the following writes the contents of the city variable to an output file named address.txt? The file is associated with the outFile object. 

a. address.txt << city << endl; 

b. ofstream << city << endl; 

c. outFile << city << endl; 

d. outFile >> city >> endl;

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: