Share via


ValidBytesConst

ValidBytesConst 속성은 올바르게 읽을 수 있는 포인터가 가리키는 배열 또는 버퍼의 바이트 수를 지정합니다. 이 속성은 Pre 및 Post 특성에서 사용할 수 있으며 포인터나 배열 데이터 형식에만 적용할 수 있습니다.

이 속성의 값은 size_t 형식의 상수입니다. 다른 매개 변수에 종속된 읽기 가능한 바이트 수를 함수에 지정하려면 ValidBytes 속성을 사용합니다.

예제

다음 코드에서는 ValidBytesConst 속성을 사용하는 방법을 보여 줍니다.

// C 
#include <CodeAnalysis\SourceAnnotations.h>
void f([SA_Pre(ValidBytesConst=2)] char *pc); 
 -or-
void f([SA_Pre(ValidBytesConst=2)][SA_Post(ValidBytesConst=4)] char *pc);
-or-
void f([SA_Pre(ValidBytesConst=2), SA_Post(ValidBytesConst=4)] char *pc);

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre(ValidBytesConst=2)] char*pc); 
 -or-
void f([Pre(ValidBytesConst=2)][Post(ValidBytesConst=4)] char *pc); 
 -or-
void f([Pre(ValidBytesConst=2), Post(ValidBytesConst=4)] char *pc);

참고 항목

개념

주석 개요

기타 리소스

주석 속성