title: Does sscanf support boolean type?
body: <p>I want to get from a string a boolean value. the string looks like that:</p>
  
  <pre><code>char *s = "value=TRUE";
  </code></pre>
  
  <p>the value could be <code>TRUE</code>, <code>FALSE</code>, <code>true</code> or <code>false</code></p>
  
  <p>I m wondering if there is a format specifier to get directly the boolean value from the string? I do not need to pass throught a string and then deduce the boolean value.</p>
  
  <p>I m looking for something like that</p>
  
  <pre><code>bool x;
  sscanf(s,"value=%b",&amp;x);
  </code></pre>
  
  <p>the question is. Is it possible to get the bool value directly with sscanf and with a format specifier?</p>
  
  <p>If not, Are there a quick method for that?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Based on the response there is no direct format specifier.</p>
  
  <p>Here a after a quick method to get the boolean value directelly</p>
  
  <pre><code>char b[8];
  if ( sscanf(s,"value=%[TtRrUuEe]",b))
     return TRUE;
  else
     return FALSE;
  </code></pre>
  
  <p>I know that the above method is limited. How ameliorate it?</p>
  
  <p>Note: the default value is False in case the value string contains garbage</p>