Can anyone help me with I/O redirection of C/C++ Program to a File without using filestreams on Repl.it

HippiiDippii

I'm trying to do I/O redirection in the open shell on repl.it. Taking the input from one file to run through the program. Outputting to a new file but nothing shows up? I'm only used to doing it from Windows using the CMD.

Shell:

~/maybe-lab6and7$ clang-7 -pthread -lm -o main main.c < address.txt > 
open.txt
~/maybe-lab6and7$ 
user3629249

After compiling and linking your program, if no compile problems and no link problems occur, you will have an executable in the current directory. (Lets say the executable is named: main.)

Then, after changing the program permissions so main is executable,
you can execute the program similar to:

./main  < sourcedata.txt  > destinationdata.txt

The result is that main can read the sourcedata.txt file from stdin and the output from the program (instead of being displayed on the terminal) will be written to destinationdata.txt.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can anyone help me with this python program?

Can anyone help me to use the enter key to execute this program?

Can anyone help me with my library catalog C program?

Can anyone help me to make this java run without error?

im trying to format my json file using d3.json(). Can anyone help me

Can anyone help me with this issue of retrieving data from Firebase using swift on Xcode? "Editor placeholder in source file"

Can anyone help me on extracting data using Json file of Yelp to the R?

Can anyone help me with this error

Can anyone help me with these minidumps?

Can anyone help me with this javascript?

Can anyone help me debug it?

Can anyone help me with reading a continuously updating video file with python?

Please can anyone help me to find out the error in the xml file

IO from a mapped file vs IO using filestreams

Can anyone help me on using GUI page in intelliJ

Can anyone help me how to creat a c program prints the center of the words inside a sentance?

When I use CMake to compile a program to catch an exception, a compile error occurs. Anyone can help me?

Can anyone help me in this design problem?

can anyone help me to resize the javaFX scene

can anyone help me to resolve MultiValueDictKeyError in django

Can anyone help me to find a error in PHP?

Can anyone help me in the below scenario in Talend

can anyone help me to turn this to js syntax?

Can anyone help me with aligning a icon by CSS?

Can anyone help me fix grub?

Can anyone help me in below scenario on DAC

Can anyone help me with this StackOverFlow.Exception?

Can anyone help me to optimize my query?

Can anyone help me convert this paperscript to javascript?