How can I supplement this code printf("\nhaystack[%i] = ", size);
that I can see the actual pseudorandom numbers that each i-th[] contain inside itself after haystack[1000] =
using this command ./generate 1000 50 | ./find 127.
Beacuse I only see an index in array i-th[] haystack[1000] =
Thank you!
for (size = 0; size < MAX; size++)
{
// wait for hay until EOF
printf("\nhaystack[%i] = ", size);
int straw = get_int(); // It can get for example 1,000 or MAX = 65536 pseudorandom numbers from ./generate 1000 via pipe | ./generate 1000 50 | ./find 127 and then find needle
if (straw == INT_MAX)
{
break;
}
// add hay to stack
haystack[size] = straw;