Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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.

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); 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.