1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Another Sscanf question

Discussion in 'Plugins' started by vefatica, Nov 19, 2008.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    If I do this,

    Sscanf(psz, L" %u-%u-%u%*[ ,]%u:%u:%u%*[ ,]%c",
    &st.wYear, &st.wMonth, &st.wDay, &st.wHour, &st.wMinute, &st.wSecond, &c)

    with the string "2008-11-19 00:00:00 u", Sscanf (correctly?) returns 7 (assignments made) and c is assigned.

    But if I do

    Sscanf(psz, L" %u-%u-%u%*[ ,]%c",
    &st.wYear, &st.wMonth, &st.wDay, &c)

    with the string "2008-11-19 u"

    Sscanf returns 3 (where 4 is expected?) and c is not assigned.

    What's going on?
     
  2. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,962
    Likes Received:
    30
    Never mind. It was my fault. I had an extra character in the second example's format string which was screwing up the search.

     

Share This Page