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

WritableElements

The WritableElements property specifies either the number of elements 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 or array data types. The value of this property is an expression that involves another parameter that specifies the actual number of writable elements. The type of the size parameter can be any integral type within the size_t range. This parameter contains the actual number of writable elements.

The following code shows how to use the WritableElements property:

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

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f ([Pre(WritableElements="c")] char *pc, size_t c);
// use of dereference operator
void f ([Pre(WritableElements="*c")] char *pc, size_t *c);
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.