473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

fclosall() and std::ofstream?

Is it ok to call fcloseall() when using both C-style FILE * and C++
std::ofstream's to read files in a program?
Thanks,
Dave
Mar 18 '08 #1
2 2351
On Tue, 18 Mar 2008 11:20:26 -0700 (PDT), Dave Johansen
<da**********@gmail.comwrote in comp.lang.c++:
Is it ok to call fcloseall() when using both C-style FILE * and C++
std::ofstream'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
Mar 19 '08 #2
On Mar 18, 6:45*pm, Jack Klein <jackkl...@spamcop.netwrote:
On Tue, 18 Mar 2008 11:20:26 -0700 (PDT), Dave Johansen
<davejohan...@gmail.comwrote in comp.lang.c++:
Is it ok to call fcloseall() when using both C-style FILE * and C++
std::ofstream'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
Mar 19 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: m vaughn | last post by:
I wanted to hold information about open files in a struct and be able pass it around, but the behavior is not what I would expect. Can someone tell me why this doesn't work? (Even better, what is...
1
by: red floyd | last post by:
Is there any way to retrieve the filename given to a std::ofstream (passed in constructor or in ofstream::open())? Or, should I derive from ofstream (should probably be a template to handle...
3
by: Chase Bradford | last post by:
Hey all I have a class Foo, and I'm trying to overload the << operator for both the ostream and ofstream for it. This way I should have two seperate formats for output, one for files and another...
3
by: jois.de.vivre | last post by:
Hi, I'm trying to write to an ofstream, and for some reason it fails. I know I can check it with fail() or bad(), but it gives me no useful information as to why it fails. Are there any C++...
8
by: davihigh | last post by:
My Friends: I am using std::ofstream (as well as ifstream), I hope that when i wrote in some std::string(...) with locale, ofstream can convert to UTF-8 encoding and save file to disk. So does...
2
by: bob | last post by:
Hi, I'm working with an ofstream object and using it to print the contents on an 100 * 100 matrix. i.e. lots of elements. the _matrix variable below is defined as std::vector<std::string,...
2
by: thinktwice | last post by:
//case 1, works fine function(..) { std::ofstream out; out.open(file); out << "error info" <<endl; out.close(); } //case 2, declare it in a class
5
by: Joe Hesse | last post by:
Hi, I have a C++ function that writes to an ofstream object. I would like to sometimes use it to write to cout. I realize that cout is of type ostream which is not ofstream. Since cout is "kind...
15
by: aaragon | last post by:
Hello, does anyone have a clue about this error? and how to solve it? It seems to be trivial to me, but not for the compiler. I'm using g++ 4.2 on an Ubuntu Linux system: // main() .......
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.