title: How to validate that an argument is a positive number?
body: <p>Although, I do define the function prototype as having a <code>size_t</code> type which is an unsigned type. I found that I can still pass negative numbers into the function, but the output will be a large signed decimal. The reason I ask this is because I want to validate an array index having known the array capacity. </p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;limits.h&gt;
  
  void print(size_t i)
  {
      printf("%zu\n", i);
  }
  
  int main()
  {
      print(-1);
  
      return 0;
  }
  </code></pre>
  
  <p>The output:
  <code>18446744073709551615</code></p>
  
  <p>Is it possible to validate that the <code>size_t i</code> variable is greater than 0? If so how can I do this? gcc doesn't like me checking for <code>i &gt;= 0</code> because it says that <code>i</code> can never be less than zero.</p>
  
  <p>Edit:</p>
  
  <p>For further explanation. Imagine that you have to validate than an arbitrary decimal is passed to a function to get an element at index i. I want to make sure that index passed in is within a boundary. That boundary is: [0, N)</p>