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
Get step-by-step solutions from verified subject matter experts
