title: Does srand(getpid()) affect format / structure?
body: <p>This question's a quick one :). I know <code>srand()</code> is used to seed a random number generator in order to prevent the same sequence of random numbers being generated. Similarly, I know that <code>getpid()</code> "shall return the process ID of the calling process."</p>
  
  <p>( <a href="http://pubs.opengroup.org/onlinepubs/009695399/functions/getpid.html" rel="nofollow">http://pubs.opengroup.org/onlinepubs/009695399/functions/getpid.html</a> )</p>
  
  <p>Due to the process ID ultimately being different each time you run my program (a program that where a producer and consumer communicate over shared memory), the PID will also be different, thus giving a perfect seed. I've set a range for the random numbers <code>rand() % (100-1) + 1</code>.</p>
  
  <p>Does <code>srand(getpid())</code> deliver random numbers in a specific format? </p>
  
  <p>For completeness, here is the section of code my enquiry relates to:</p>
  
  <pre><code>srand(getpid());
  
  while(x == 0)
  {      
          if(*randNum == 101)
          {      
                  *randNum = rand() % (100 - 1) + 1;
                  *pidNum = getpid();
  
                  printf("priority: %d Process ID: %d \n", *randNum, *pidNum);
  
                  x = 1;
          }   
          else
          {      
                  *randNum++;
                  *pidNum++;
          }   
  }   
  </code></pre>