Question: Write a function checkFile that opens up a file in C++ language. The function takes one parameter, the name of the file filename . The

Write a function checkFile that opens up a file in C++ language. The function takes one parameter, the name of the file filename. The function should return true if the file was open successfully otherwise it should return false.

For example, assume a file called myFile.txt exists in your workspace, then a function call to checkFile(...)

checkFile("myFile.txt")

would return true because the file exists in the system.

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!