Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

C++ fstream: I can't reopen files


  • Please log in to reply

#1
Mc1brew

Mc1brew

    New Member

  • Member
  • Pip
  • 2 posts
Hello, I am working on a program that has to open files for quick checks and then make some decisions yatta yatta. So far all the logic etc is coming pretty easy, however I noticed that once I have a fstream open, then close it using the objectname.close() method I cannot reopen that file. I have tried using a completely different scope, and different object names, neither seemed to have improved my situation. Is it possible I need to do some sort of buffer flush? How can I make this problem go away?
  • 0

Advertisements


#2
pomp

pomp

    the man

  • Member
  • PipPipPipPip
  • 1,366 posts
You could try and post the code to the program so we could try and give it a look. Are you fstreaming a text file? Attach that to your post.
  • 0

#3
Mc1brew

Mc1brew

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
So yeah, I actually resolved this problem on my own, turns out fstream is just really touchy about scopes. Sorry to waste space/time, feel free to delete this thread.
  • 0

#4
stu_design

stu_design

    Member

  • Member
  • PipPipPip
  • 217 posts
plz in the future plz keep profaninity to u self plz
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP