Declare an fstream object named a_log. Using a_log, check if the file activityLog exists. If the file activityLog does not already exist, open it for writing using a_log; otherwise open the file activityLog2 for writing using a_log.

Declare an fstream object named a_log. Using a_log, check if the file activityLog exists. If the file activityLog does not already exist, open it for writing using a_log; otherwise open the file activityLog2 for writing using a_log.

LANGUAGE: C++

CHALLENGE:

Declare an fstream object named a_log. Using a_log, check if the file activityLog exists. If the file activityLog does not already exist, open it for writing using a_log; otherwise open the file activityLog2 for writing using a_log.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level