Results 1 to 3 of 3

Thread: fstream not working

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: fstream not working

    Your fstream declaration in line 17 assumes that the file is in your current working directory. You might be surprised to learn that the working directory may not be what you think it is. Add a call to the static method QDir::currentPath() and see if the return QString contains what you think it should.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    MongKong (10th March 2020)

Similar Threads

  1. Reading Binary Files From Asset folder using "fstream"
    By saad_saadi in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 24th June 2015, 09:20
  2. Use fstream with a QDialog
    By gtnoob in forum General Programming
    Replies: 2
    Last Post: 19th October 2012, 19:57
  3. QFile -> std::fstream
    By bhs-ittech in forum Qt Programming
    Replies: 1
    Last Post: 9th June 2008, 10:02
  4. fstream open/close
    By mickey in forum General Programming
    Replies: 4
    Last Post: 13th October 2006, 12:23
  5. fstream -> stdout
    By zlatko in forum General Programming
    Replies: 11
    Last Post: 25th January 2006, 05:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.