2

ここから:

_s および _p サフィックスが付いたこれらの関数のバージョンは、より安全なバージョンです。これらのバージョンは、フォーマット文字列を検証し、フォーマット文字列が適切に形成されていない場合 (たとえば、無効なフォーマット文字が使用されている場合) に例外を生成します。

書式文字列が出力バッファ サイズよりも大きい場合、書式文字列が適切に形成されていないと見なされることを発見しました。すべての *_s 印刷関数についてこれを確認するドキュメントを知っている人はいますか?

ありがとう

4

1 に答える 1

1

Looks like the default behavior is to throw the CRT error if output buffer size is exceeded, regardless of source. I expected the output to be silently truncated if the output buffer size is exceeded. Thus, there is no point in attempting to fill in the format string if it is too long already.

于 2010-12-20T17:47:37.060 に答える