title: How to convert unsigned long to string
body: <p>In the C language, how do I convert <strong>unsigned long</strong>  value to a string (<strong>char *</strong>) and keep my source code portable or just recompile it to work on other platform (without rewriting code?</p>
  
  <p>For example, if I have <code>sprintf(buffer, format, value)</code>, how do I determine the size of buffer with platform-independent manner?</p>