Search Result

Collapse
3 results in 0.0023 seconds.
Keywords
Members
Tags
sscanf
  •  

  • How to parse string with sscanf that have a empty field?

    Hi,

    I am handling tab delimited txt files that have multiple fields. But some of the fields can be empty. So it will appear as <TAB><TAB> in the file rather than <TAB>something< TAB>. If I read in the line and then use something like


    Code:
    sscanf(buf0, "%s %ld %ld %s %s %s %s %s", chr, &bg, &ed, zg, var, ref, s1, s2);
    The program will skip these...
    See more | Go to post

  • Gcc doesn't seem to get my scanf right, but Visual Studio does, what's wrong?

    First I actually thought there was something wrong with my programming skills. But after I compiled the same code using Visual Studio, it worked. So here's the code that doesn't seem to be working right with gcc compilers, but they do compile. Note I'm using the Cygwin 3.4.4 version of gcc and 4.5.1 version of gcc from MinGW.

    Code:
    #include <stdio.h>
    #include <math.h>
    int main()
    {
        long double r = 0;
    ...
    See more | Go to post
    Last edited by Bangonkali; Dec 11 '10, 07:47 AM. Reason: Revised Formatting

  • Kevin Goodsell
    Guest started a topic sscanf return value with "%n" directive
    in C

    sscanf return value with "%n" directive

    The return value of sscanf should be "the number of input items
    assigned" (unless an input failure occurs before any conversion). Are
    items assigned due to a "%n" directive included in the returned count?

    Thanks.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting....
    See more | Go to post
Working...