473,405 Members | 2,349 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,405 software developers and data experts.

freopen()

After I have redirected output to a file (james.txt)...

freopen("james.txt", "w", stdout);

after the prog has written what needs to be written to the file how do I direct
output back to the monitor?

Thanks :)
Nov 13 '05 #1
1 3358
Teh Charleh wrote:
After I have redirected output to a file (james.txt)...

freopen("james.txt", "w", stdout);

after the prog has written what needs to be written to the file how do I direct
output back to the monitor?


This is a FAQ.

http://www.eskimo.com/~scs/C-faq/q12.34.html

--
Enrico `Trippo' Porreca

Nov 13 '05 #2

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

Similar topics

1
by: Alex Vinokur | last post by:
Hi, Where has output-to-cout gone in the program below? Thanks, ========= C++ code : File foo.cpp : BEGIN ========= #include <cstdio> #include <cassert> #include <iostream>
4
by: Rouben Rostamian | last post by:
Consider the following demo program: #include <stdio.h> int main(void) { unsigned char c; for (c=0; c<15; c++) putchar(c);
2
by: Alex Vinokur | last post by:
Hi, freopen closes stdout, but it seems that fclose doesn't restore it (see sample below). How can one print to stdout after using freopen? ========= C code : File foo.c : BEGIN...
8
by: John Forkosh | last post by:
I have a C program that writes binary output to stdout, which works fine in Unix/Linux. But when someone else compiled and ran it in Windows, every time the program emitted a 0x0A, Windows...
3
by: John Devereux | last post by:
Hi, I am a bit confused about the behaviour of freopen() and the standard i/o streams. I am trying to redirect a stream (stderr) to a particular "file". But, if the call fails I want it to...
1
by: joshuawilsonster | last post by:
I have checked: http://c-faq.com/stdio/undofreopen.html and don't believe it addresses my question. I am dealing with large files of numbers and want to take in small chunks and act on...
1
by: system55 | last post by:
is it possible to reopen a file (using freopen) eventhough that file is already opened by an fopen function???
4
by: Hlk.Turk | last post by:
Hi All, I have a question regarding the standard C library. Is it possible to have one process (program) that redirects its stdin to a file, and have a second program use that file...
2
by: Guillaume Dargaud | last post by:
Hello all, a while ago I was pointed towards freopen as a way to redirect stderr to a log file. It works great, but apparently the app also writes a few lines to stdout. Now I could redirect to 2...
5
by: Joakim Hove | last post by:
Hello, I have written a program in C; this programs uses an external proprietary library. When calling a certain function in the external library, the particular function writes a message to...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.