title: Reducing rand() pool in C
body: <p>I'm currently building a plane loading simulation, and am using the <code>rand()</code> function in C to generate a random number between 0 and some upper bound in order to allocate passengers to their seats.</p>
  <p>Therefore, once a passenger has been allocated, I don't want the <code>rand()</code> function to select that passengers seat/row again. That is, I want that number to be taken out of the selection pool that <code>rand()</code> selects from.</p>
  <p>Is there a way to do this? I know I can simply check if it has been selected and re-select if it has, but I was wondering if there was another way.</p>
  <p>Thanks!</p>
  <p>Btw, here is a snippet of the code for some context</p>
  <pre><code>int row = rand() % amount_rows/2; // don't want to select the same row/col twice
  int col = rand() % amount_cols;
          
  if (1 != passengers[row][col].in_row) {
      passengers[row][col].in_row = 1;
  }
  </code></pre>