Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > fclosall() and std::ofstream?

Reply
Thread Tools

fclosall() and std::ofstream?

 
 
Dave Johansen
Guest
Posts: n/a
 
      03-18-2008
Is it ok to call fcloseall() when using both C-style FILE * and C++
std:fstream's to read files in a program?
Thanks,
Dave
 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      03-19-2008
On Tue, 18 Mar 2008 11:20:26 -0700 (PDT), Dave Johansen
<(E-Mail Removed)> wrote in comp.lang.c++:

> Is it ok to call fcloseall() when using both C-style FILE * and C++
> std:fstream's to read files in a program?
> Thanks,
> Dave


No idea. There is no "fcloseall()" function in either the standard C
or the standard C++ library. So you will have to consult the provider
to find out what it does or does not do.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 
Reply With Quote
 
 
 
 
Dave Johansen
Guest
Posts: n/a
 
      03-19-2008
On Mar 18, 6:45*pm, Jack Klein <(E-Mail Removed)> wrote:
> On Tue, 18 Mar 2008 11:20:26 -0700 (PDT), Dave Johansen
> <(E-Mail Removed)> wrote in comp.lang.c++:
>
> > Is it ok to call fcloseall() when using both C-style FILE * and C++
> > std:fstream's to read files in a program?
> > Thanks,
> > Dave

>
> No idea. *There is no "fcloseall()" function in either the standard C
> or the standard C++ library. *So you will have to consult the provider
> to find out what it does or does not do.
>
> --
> Jack Klein
> Home:http://JK-Technology.Com
> FAQs for
> comp.lang.chttp://c-faq.com/
> comp.lang.c++http://www.parashift.com/c++-faq-lite/
> alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html


I did a little more research and it is actually a GNU and Microsoft
extension, but it causes problems when using static/global fstream's
because the destructors try to close the FILE * that has already been
closed.

Dave
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM



Advertisments