Hey guys I started to run a C++ my program in Linux and I don't know how to test my program that works fine with a text file. This is a project for my uni and to explain more clear, My program is a sample database for modify or add and search and it read data from a binary file and also write into a binary file.
I have got an input from my lecture and she said after compiling in Linux I must
write:
I usually do Step 3 in a different way but should be same objective.
cat input.txt | ./a.out > output.txt
I like it this way as it convey the workflow from open up an input file, feed to a program to process and then write to a output file. I find this easier to visualize.
Does your program read from standard input (cin, scanf) an write to standard output (cout, printf) ? Also you said that it works with binary files, not text files, so what are you expecting to see?
$ ./program.bin Executes the program, read from keyboard write to the console $ ./program.bin < input_file Executes the program, read from input_file write to the console. $ ./program.bin > output_file The output is send to the output_file $ ./program.bin | tee output_file Write to the output_file and also visualise in the console
If you want to redirect the error stream (cerr) use $ ./program.bin 2>error_log
To send both error and normal output to the same $ ./program.bin 1>out_file 2>&1
Basically, show what is inside the cat file, which is about "control code" for the a.out input to your program.Last time I saw a [url="http://www.buyctjewelry.com/C-61-b0"]Cartier Pendants[/url] and actually that not charming enough but I really like it.And what a pity I lost it finally so I really regret now!