If I use ./generate 10, I can successfully printf a random list, and if I use ./find 42, there successfully comes prompts to a ask me input numbers. However, if I use ./generate 10 | ./find 42, the result is just like:
haystack[0] =
haystack[1] =
haystack[2] =
haystack[3] =
haystack[4] =
haystack[5] =
haystack[6] =
haystack[7] =
haystack[8] =
haystack[9] =
haystack[10] =
I predict there should be int being saved in to haystack. Then I tried debug50 ./generate 10 | ./find 42
,result:
WARNING: Could not set any breakpoints. Try deleting ./generate and re-compiling
your code. Be sure to compile with -ggdb3.
That beat me. I only typed codes in help.c and I didn't change the code in both generate.c and find.c, just like the guide said. Did I get something wrong?