Dela via


WritableBytes

The WritableBytes property specifies either the number of bytes of an array or a buffer pointed to by a pointer that can be legally written to. This property is allowed on Pre and Post attributes and can be used on pointer and array data types. The value of this property is an expression that involves another parameter, which contains the actual number of writable bytes.

Example

The following code shows how to use WritableBytes property:

// C
#include <CodeAnalysis\SourceAnnotations.h>
void f ([SA_Pre(WritableBytes="c")] char *pc, size_t c); 

// use of dereference operator
void f ([SA_Pre(WritableBytes="*c")] char *pc, size_t *c); 

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f ([Pre(WritableBytes="c")] char *pc, size_t c); 

// use of dereference operator
void f ([Pre(WritableBytes="*c")] char *pc, size_t *c); 

See Also

Concepts

Annotation Overview

Other Resources

Annotation Properties