Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>WELL-FORMED INPUT ONLY</p> <pre><code>if (fscanf(FILE_PTR, "(%d,%d,...,%c,%c,%c,...,%c) %*d", &amp;column, &amp;row, ..., &amp;chars[0], &amp;chars[1], ...) == 60) </code></pre> <p>or something like that</p> <p>the <code>%*d</code> specifier will discard that input (you didn't want the last number)</p> <p>for the chars, give pointers to their indices for a preallocated array</p> <p>for the ints, give the variable pointer/ref</p> <p>Thank you to Jon Leffler for reminding that you should test the output of <code>*scanf</code> (number of things read)!</p> <p><a href="http://en.cppreference.com/w/cpp/io/c/fscanf" rel="nofollow">More information</a></p> <p><strong>REEDIT</strong> nope, it was right -</p> <blockquote> <p><code>int fscanf ( FILE * stream, const char * format, ... );</code></p> <p><code>format</code>: C string that contains a sequence of characters that control how characters extracted from the stream are treated:</p> <ul> <li>Whitespace character: the function will read and ignore any whitespace characters encountered before the next non-whitespace character (whitespace characters include spaces, newline and tab characters -- see isspace). A single whitespace in the format string validates any quantity of whitespace characters extracted from the stream (including none).</li> <li><strong>Non-whitespace character, except format specifier (%): Any character that is not either a whitespace character (blank, newline or tab) or part of a format specifier (which begin with a % character) causes the function to read the next character from the stream, compare it to this non-whitespace character and if it matches, it is discarded and the function continues with the next character of format. If the character does not match, the function fails, returning and leaving subsequent characters of the stream unread.</strong></li> <li>Format specifiers: A sequence formed by an initial percentage sign (%) indicates a format specifier, which is used to specify the type and format of the data to be retrieved from the stream and stored into the locations pointed by the additional arguments.</li> </ul> </blockquote> <p>Above quote from <a href="http://www.cplusplus.com/reference/cstdio/fscanf/" rel="nofollow">here.</a> I am aware of the hostility towards cplusplus.com here but I do not have access to the standard. please feel free to edit if you do</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload