Note on creating an array of procedure pointers

N. Clerman
{"title":"Note on creating an array of procedure pointers","authors":"N. Clerman","doi":"10.1145/1520752.1520753","DOIUrl":null,"url":null,"abstract":"Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type","PeriodicalId":379614,"journal":{"name":"ACM SIGPLAN Fortran Forum","volume":"31 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-03-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"1","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM SIGPLAN Fortran Forum","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1520752.1520753","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 1

Abstract

Introduction Fortran programmers know that it is not possible to directly form an array of pointers. To the uninitiated, the notation may be somewhat confusing. The following line of code is a declaration of an array of intrinsic type real. real , dimension (20) :: samples But the following line of code is a declaration of a pointer to an array of real values, not an array of pointers. real , dimension (:) , pointer :: ptr_samples And in the following code, a pointer assignment points ptr_samples at the samples array. ptr_samples => samples To create an array of pointers, you can define a data type whose sole component is a pointer, and you can then use an array of this new type as a pointer array. type Real_Ptr_Type real , dimension (:) , pointer :: real_ptr_comp end type Real_Ptr_Type
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
注意创建过程指针数组
Fortran程序员知道直接形成指针数组是不可能的。对于没有经验的人来说,这个符号可能有些令人困惑。下面一行代码声明了一个内部类型为real的数组。但是下面这行代码是一个指针的声明,它指向一个实值数组,而不是一个指针数组。在下面的代码中,一个指针赋值指向samples数组中的ptr_samples。为了创建指针数组,你可以定义一个数据类型,它的唯一组成部分是指针,然后你可以使用这个新类型的数组作为指针数组。type Real_Ptr_Type real, dimension (:), pointer:: real_ptr_comp end type: Real_Ptr_Type
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Compiler Support for the Fortran 2008 and 2018 Standards The diagnostic capability of the Cray, gfortran, Intel, Nag and Oracle Fortran compilers The diagnostic capability of the Cray, gfortran, Intel, Nag and Oracle Fortran compilers Experimenting with generic programming features History of Fortran
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1