Could somebody please tell me how do I write a file in "try catch" block for checking if the file exists, if it is opened, if it is not empty. This is the error message I get when the file not exist or it is empty.
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr