nMaxCount [in] Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.
>>356 たいてい最後は0が入るよ。lstrncpyさえも。 MSDNの説明はこんな感じ > [out] Pointer to the buffer that will receive the text. If the string > is as long or longer than the buffer, the string is truncated and > terminated with a NULL character.
>>362 ????? MSDNのGetModuleFileNameの解説より lpFilename [out] Pointer to a buffer that receives a null-terminated string that specifies the fully-qualified path of the module. If the length of the path exceeds the size specified by the nSize parameter, the function succeeds and the string is truncated to nSize characters and null terminated.
っていうか、msdn にはこうあるけど・・・ ttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getmodulefilename.asp lpFilename [out] Pointer to a buffer that receives a null-terminated string that specifies the fully-qualified path of the module. If the length of the path exceeds the size that the nSize parameter specifies, the function succeeds, and the string is truncated to nSize characters and "cannot be null terminated".
typedef struct _SYSTEMTIME { WORD wYear; WORD wMonth; WORD wDayOfWeek; WORD wDay; WORD wHour; WORD wMinute; WORD wSecond; WORD wMilliseconds; } SYSTEMTIME, *PSYSTEMTIME, *LPSYSTEMTIME;
C = 繰り上がりがある場合の繰り上がり (v0 & v1) <<1 S = 繰り上がりを無視した加算結果 (v0 ^ v1) C + S は足すと普通の加算になる。右に1シフトする(2で割る)と平均になる。 (S は各バイトの最下位ビットが立っている可能性があるから、0xfefefefeでマスクしておく)