Sscanf()?

#1
With swscanf() I can take apart a datetime using this format string.

Code:
L"%4hu%2hu%2hu%2hu%2hu%2hu"
Can it be done with Sscanf()? If so, what should the format string be?

Thanks.
 

rconn

Administrator
Staff member
May 14, 2008
10,588
97
#2
With swscanf() I can take apart a datetime using this format string.

Code:
L"%4hu%2hu%2hu%2hu%2hu%2hu"
Can it be done with Sscanf()? If so, what should the format string be?

Thanks.
Yes, and the same.

Though I've also told you (several times!) that I do *not* recommend using Sscanf() and Ssprintf(), as they have a number of internal variations specifically for TCC. (And I will not modify them for any perceived incompatibility with the RTL functions.)
 
#3
On Mon, 31 May 2010 22:06:59 -0400, rconn <> wrote:

|---Quote (Originally by vefatica)---
|With swscanf() I can take apart a datetime using this format string.
|
|
|Code:
|---------
|L"%4hu%2hu%2hu%2hu%2hu%2hu"
|---------
|Can it be done with Sscanf()? If so, what should the format string be?
|
|Thanks.
|---End Quote---
|
|Yes, and the same.
|
|Though I've also told you (several times!) that I do *not* recommend using Sscanf() and Ssprintf(), as they have a number of internal variations specifically for TCC. (And I will not modify them for any perceived incompatibility with the RTL functions.)

Tests show that "%2h" and "%2u" work and that "%2hu" doesn't. If I'm filling
WORDs I suppose I should be using "%2h" ... right?

I am not suggesting you change it. It's just fine as it is. I just use it so
seldom that I must re-discover its peculiarities.
--
- Vince