---
title: 写入属性
description: 将数据写入属性。
url: "https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0089.html"
---

# 写入属性

#### 函数定义

将数据写入属性。

herr_t H5Awrite(hid_t attributeId, hid_t datatypeId, const void *buffer )


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| attributeId | 要写入的属性的标识符。 | 整数 | 输入 |
| datatypeId | 属性数据类型的标识符（在内存中）。 | 整数 | 输入 |
| \*buffer | 要写入的数据。 | 非空 | 输入 |


#### 返回值

- 成功：返回非负值。
- 失败：返回负值。
