Questions tagged [haystack]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

find.c in Pset 3; int straw = get_int(); ./generate 1000 50 | ./find 127; Why I can't see this pseudorandom numbers?

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 ./...
Yellowfun's user avatar
0 votes
1 answer

helpers.c passes check50 but fails ./generate 1000 50 | ./find 128

check50 gives me all smiles, but when I run the test code ./generate 1000 50 | ./find 127 or 128 they both return "Found needle in haystack". How is that possible? And also, can I be sure my code is ...
Lele's user avatar
  • 67
0 votes
1 answer

Helpers code never finds a needle

I am working on helpers.c in pset3. I have the following code. Find.c compiles with helpers.c, but when I run it with "./generate 1000 50 | ./find 127", it lists lines with "haystack[n] =" where n = ...
REW's user avatar
  • 1
2 votes
1 answer

"subtraction" of string in pset6 server.c

In server.c in pset6, there is a line of code where a string is "subtracted" from a string. I tried to find out what this operation does by writing a simple program : char* needle = "needle"; ...
Quevun's user avatar
  • 161
1 vote
1 answer

Piping generate pset3

I just wondering if some one can confirm for me that I understand what exactly is going on here when a file gets piped into another program. Generate is producing a certain number of random numbers ...
William Kenney's user avatar
0 votes
1 answer

pset3 find.c corner case

I made a for loop for searching and sorting in the header file. Both loops start off like this: for (int i = 0; i < n ; i++) find.c compiles fine for me but when I put the needle at the end of ...
hunter's user avatar
  • 31