Re: Using strsafe.h and va_list
From: Nikolaos D. Bougalis (nikb_at_webmaster.com)
Date: 05/26/04
- Next message: Tim: "Re: Using strsafe.h and va_list"
- Previous message: Tim: "Re: Using strsafe.h and va_list"
- In reply to: Tim: "Re: Using strsafe.h and va_list"
- Next in thread: Tim: "Re: Using strsafe.h and va_list"
- Reply: Tim: "Re: Using strsafe.h and va_list"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 May 2004 03:23:52 -0700
Tim wrote:
> sizeof expression
>
> The sizeof keyword gives the amount of storage, in bytes, associated with a
> variable or a type (including aggregate types). This keyword returns a value
> of type size_t.
You seem to not read my code very well:
#define tchar_size(x) (sizeof(x) / sizeof(TCHAR))
Let's assume this:
TCHAR buf[512];
In UNICODE builds, tchar_size(buf) expands to: (sizeof(buf) /
sizeof(TCHAR)) which is (1024 / 2) or 512.
In non-UNICODE builds, tchar_size(buf) expands to (sizeof(buf) /
sizeof(CHAR)) which is (512 / 1) or 512.
Any questions?
-n
- Next message: Tim: "Re: Using strsafe.h and va_list"
- Previous message: Tim: "Re: Using strsafe.h and va_list"
- In reply to: Tim: "Re: Using strsafe.h and va_list"
- Next in thread: Tim: "Re: Using strsafe.h and va_list"
- Reply: Tim: "Re: Using strsafe.h and va_list"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|