title: What is the purpose of WSA_WAIT_EVENT_0 in overlapped IO?
body: <p>All my experience in networking has been on linux so I'm an absolute beginner at windows networking.  This is probably a stupid question but I can't seem to find the answer anywhere.  Consider the following code snippet:</p>
  
  <pre><code>    DWORD Index = WSAWaitForMultipleEvents(EventTotal, EventArray, FALSE, WSA_INFINITE, FALSE);
      WSAResetEvent( EventArray[Index - WSA_WAIT_EVENT_0]);
  </code></pre>
  
  <p>Every time an event is selected from the EventArray <code>WSA_WAIT_EVENT_0</code> is subtracted from the index but <code>WSA_WAIT_EVENT_0</code> is defined in <code>winsock2.h</code> as being equal to zero.</p>
  
  <p>Why is code cluttered with this seemingly needless subtraction?  Obviously the compiler will optimize it out but still don't understand why it's there.                                         </p>