CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #3
    Join Date
    Jul 2017
    Location
    Greece
    Posts
    130

    Re: Why does this simple file read method does not work?

    Quote Originally Posted by 2kaud View Post
    The catch clause should be by ref:

    Code:
    catch (std::ifstream::failure& e)
    I did it but the issue was not fixed...

    By the way if I remove the line:
    Code:
    //Set exception mask for file stream.
    file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
    then this access violation is not been thrown.
    Last edited by babaliaris; August 28th, 2020 at 10:27 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured