exclusive error handling for ofstream closing

S

shyam

Hi All

Does ofstream.close() ever fail?
If yes then how do i ckeck for it?

Also ,suppose i have a open() call and a cloas() call inside the same
try catch block
how do i differentiate between wheather its an file opening error or
file closing error?

thanks
shyam
 
A

Alf P. Steinbach

* shyam:
Does ofstream.close() ever fail?
Yes.


If yes then how do i ckeck for it?

Read the documentation (it's just two lines, shouldn't be too much?).

Also ,suppose i have a open() call and a cloas() call inside the same
try catch block
how do i differentiate between wheather its an file opening error or
file closing error?

If you have a problem with specific code, post the smallest example that
compiles and exhibits the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,690
Members
48,796
Latest member
Greg L.

Latest Threads

Top