---
title: 设置变量填充值
description: "nc_def_var_fill(int ncid, int varid, int no_fill, const void* fill_value)"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0050.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0050.html
indexId: 471dbfe6f7c2fad5879ca7b3cf6fdd88d05c48cb61ce1ac1c49e513982ab5dab58
---
# 设置变量填充值

#### 函数定义

nc_def_var_fill(int ncid, int varid, int no_fill, const void* fill_value)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| ncid | 文件ID | 非负整数 | 输入 |
| varid | 变量ID | 非空 | 输入 |
| no\_fill | 是否填充 | NC\_NOFILL或NC\_FILL | 输入 |
| \*fill\_value | 指向填充值的指针 | 非空 | 输入 |


#### 返回值

- 成功：返回NC_NOERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| NC\_EBADID | 无效ncid |
| NC\_ENOTVAR | 无效变量ID |


#### 注意

中间件暂时没有填充值功能，函数未完成功能上的支持。
