Wednesday, February 25, 2015

How can you restore a redirected standard stream?

Question:How can you restore a redirected standard stream??

Answer: </I>The preceding example showed how you can redirect a standard stream from within your program. But what if later in your program you wanted to restore the standard stream to its <I>original </I>state? By using the standard C library functions named dup() and fdopen(), you can restore a standard stream such as stdout to its original state. The dup() function duplicates a file handle. You can use the dup() function to save the file handle corresponding to the stdout standard stream. The fdopen() function opens a stream that has been duplicated with the dup() function.&nbsp;

Tags:Interview Questions, Languages, C,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Real Estate Management Software

Real Estate Management System Software

Real Estate Management Software is an advanced end-to-end Real Estate Office Management System that enables Real Estate Agencies to manage more effectively, search prorty details, keep property owner data etc. Web-based tracking and accounting solution ideal for commercial, residential housing....

No comments:

Post a Comment