title: size_t to unsigned int (from API function)
body: <p>I am using the Oracle API to access a database and this API has a function <code>readBuffer(char * buffer, unsigned int size);</code> to which I cannot make any changes.</p>
  
  <p>I have a class that uses this API and the signature of my function currently takes a <code>std::string</code> and an <code>unsigned int</code> for the size, the problem is that when I pass <code>std::string.size()</code> to the size argument of my function, I get a warning from my compiler that converting from <code>size_t</code> to <code>unsigned int</code> could cause data loss. </p>
  
  <p>I wondered if there is a <strong>valid way</strong> to convert the <code>size_t</code> to an <code>unsigned int</code> so I can pass it to my API and not get a warning from the compiler?</p>
  
  <p>I understand the purpose of size_t and searching google for this conversion turns up a lot of results that say "change the function to take a size_t arg" but I <strong>CANNOT</strong> change the signature of my API in this case.</p>
  
  <p>Any suggestions?</p>