wwwww
This is a discussion on Filling an array and searching for a value within the C Programming forums, part of the General Programming Boards category; wwwww...
wwwww
Last edited by alex83; 01-16-2011 at 05:19 AM.
What's sizeof(int) on your system? If it's not 8, then you won't be able to fit 10 billion into that array slot anyway. Once you know you can store the answer, then you can look at how to generate the numbers -- check RAND_MAX to see whether rand() gives you numbers that high.
In your find function, I don't think you want those small do-while loops -- what if the rightmost element was smaller than your pivot? You'll never find it the way you have it.