I can’t think of a way to do this in a cross-platform manner, but on GNU/Linux systems (and maybe other POSIX-compliant ones, too) you can freopen ("/dev/tty", "a", stdout)
. Is this what you were trying to do?
More Related Contents:
- How do I make this Linux program compile? [closed]
- Return value range of the main function
- When should I use mmap for file access?
- What is the equivalent to Posix popen() in the Win32 API?
- Connecting n commands with pipes in a shell?
- Atomicity of `write(2)` to a local filesystem
- GCC with -std=c99 complains about not knowing struct timespec
- POSIX API call to list all the pthreads running in a process
- Why does stdout need explicit flushing when redirected to file?
- Kill Thread in Pthread Library
- What is the simplest way to write to stdout in binary mode?
- Checking if a file is a directory or just a file [duplicate]
- Are there any platforms where using structure copy on an fd_set (for select() or pselect()) causes problems?
- How can I convert a file pointer ( FILE* fp ) to a file descriptor (int fd)?
- How to get the current time in milliseconds from C in Linux?
- What is the proper #include for the function ‘sleep()’?
- write() to stdout and printf output not interleaved?
- Create statically-linked binary that uses getaddrinfo?
- How to make parent wait for all child processes to finish?
- Writing to stdin and reading from stdout (UNIX/LINUX/C Programming)
- Is snprintf() ALWAYS null terminating?
- Scanf/Printf double variable C
- How to buffer stdout in memory and write it from a dedicated thread
- Redirect stdout to a file
- How to use nanosleep() in C? What are `tim.tv_sec` and `tim.tv_nsec`?
- C restore stdout to terminal
- How to convert from UTC to local time in C?
- Linux shared memory: shmget() vs mmap()?
- Checking if errno != EINTR: what does it mean?
- How to know if a Linux system call is restartable or not?