Check if valid date
#4

The delimiters can be done with "p" or "P" (for optional) specifiers. Optional specifier is needed sometimes to avoid some sscanf warnings when characters such as parenthesis are used.

pawn Код:
// assuming "text" stores "03/06/2016"
new
    dd,
    mm,
    yy;

sscanf(text, "p</>iii", dd, mm, yy);
// dd = 3
// mm = 6
// yy = 2016
Reply


Messages In This Thread
Check if valid date - by Jonesy96 - 03.06.2016, 09:12
Re: Check if valid date - by PrO.GameR - 03.06.2016, 09:31
Re: Check if valid date - by Jonesy96 - 03.06.2016, 11:14
Re: Check if valid date - by Konstantinos - 03.06.2016, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)