---
title: 句柄转换
description: "- 将C句柄转换为Fortran句柄。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0030.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/userg_hyperio_0030.html
indexId: 671f201458b19ca406716e369a94169fe8057f43a8fb6dc27c2660964773132158
---
# 句柄转换

#### 函数定义

- 将C句柄转换为Fortran句柄。
  MPI_File_c2f(MPI_File file)

  PMPI_File_c2f(MPI_File file)

- 将Fortran句柄转换为C句柄。
  MPI_File_f2c(MPI_Fint file)

  PMPI_File_f2c(MPI_Fint file)


#### 参数

| 参数名 | 描述 | 取值范围 | 输入/输出 |
| --- | --- | --- | --- |
| file | c/fortran格式句柄 | 非负 | 输入 |


#### 返回值

- 成功：返回Fotran/c格式句柄。
- 失败：返回NULL。


#### 注意

MPI_File_c2f与MPI_File_f2c仅转换文件句柄。
