Works like a charm, thanks a bunch!
Type: Posts; User: dasbush
Works like a charm, thanks a bunch!
I suppose I could leave it and have the user redirect... but I would prefer the other way (out of simple curiosity at this point).
Edit:
I'll look into this and see how it goes.
I'm writing a program that calculates prime numbers and I would like to put the output to a file if the user gave a filename for an argument.
Unfortunately I have to use windows and not linux, so...
I just figured it out...
#include <stdio.h>
#include <fcntl.h>
int main()
{
int file;
Thanks a lot, but that didn't really solve the issue...
Basically, I am writing a simple shell. So the output from the commands entered into the shell (such as cp, rm, mv) would go to stdout and...
The problem I am facing is the need to write to stdout and to another file. I want the output to be displayed on the screen and into the file. This program is similar to the script command already...