Hot answers tagged


Inputting data to programs can be done in many different ways. For example, you may input data from the standard input or stdin (e.g., your keyboard). You may input data from a file or a stream. Or you may input data from another program's output (aka piping). When you execute ./generate 1000, generate is supposed to generate and output* newline-separated ...


Because the arguments passed to your program are only 2: the name of your program (./arg-0) the argument you pass to it (pri). The > file.txt part of the command is used by the command line to redirect the standard output of your program, and is not passed as an argument in your program.


Generate is producing a certain number of random numbers and then saves it in a text file. Then the numbers are being fed into find.c terminal one at a time the first time every time the find function needs a command line argument. (It doesn't seem to matter here if there are more text lines than command lines arguments. The program knows never feed ...

Only top voted, non community-wiki answers of a minimum length are eligible