In the pset3, we need to make a Makefile to compile for generate.c and find.c files. In this case, the output of the generate.c file is piping to the find.c file. Would anyone help me with this? Thanks.
Sorry for my English in advance. If I understood you right, please let me explain. Let's say you want to pipe 1000 values generated by program "generate" to program "find".
You are going to need to compile the programs first.
To compile them easier not using clang, but with typing "make" command to terminal you may edit Makefile, which includes *.c file names you want to compile and *.h file names of libraries or "helpers" you are using. Actually Makefile hold short commands you want your terminal to understand. For instance you can assign that if you type "clean" in terminal it will delete both find and generate programs, and it means you don't need to type rm -f *.o a.out core find generate". Or if you type "make find" it will mean "execute command": clang -ggdb3 -O0 -std=c11 -Wall -Werror -o find find.c helpers.c -lcs50 -lm (So that you don't have to type that long message to terminal window each time you want to compile the program).
After you compiled....
Than you need to type in console(terminal) with pipe sign(|): ./generate 1000 | ./find 42
Alternatively, you can use another command, like "rederict" in terminal window:
./generate 1000 > numbers.txt
Hope it answers your question. If yes, please tick this answer on the left. If not, please comment!