title: Keeping track of a list of integers in C, and sampling from the list
body: <p>Let's just say that at the simplest, I have a function that generates random integers. Every number generated I want to tack onto the end of the list.</p>
  
  <p>Then, at the end, I want to sample a random numbers from this list.</p>
  
  <p>I'm quite newb at C, manoeuvring around singly-linked lists and pointer arguments, so any advice would be welcome.</p>
  
  <p><strong>edit:</strong> I have no problem switching to C++ if there are structures that would help me out. I just need lists and sampling. </p>