title: scanf("%d", char*) - char-as-int format string?
body: <p>What is the format string modifier for char-as-number?</p>
  
  <p>I want to read in a number never exceeding 255 (actually much less) into an unsigned char type variable using sscanf.</p>
  
  <p>Using the typical</p>
  
  <pre><code> char source[] = "x32";
   char separator;
   unsigned char dest;
   int len;
  
   len = sscanf(source,"%c%d",&amp;separator,&amp;dest);
   // validate and proceed...
  </code></pre>
  
  <p>I'm getting the expected warning: argument 4 of sscanf is type char*, int* expected.</p>
  
  <p>As I understand the specs, there is no modifier for char (like %sd for short, or %lld for 64-bit long)</p>
  
  <ul>
  <li>is it dangerous? (will overflow just overflow (roll-over) the variable or will it write outside the allocated space?)</li>
  <li>is there a prettier way to achieve that than allocating a temporary int variable?</li>
  <li>...or would you suggest an entirely different approach altogether?</li>
  </ul>