fortran指针
来源:互联网 发布:编程与机械 编辑:程序博客网 时间:2024/04/29 19:32
A pointer is a
variable that has the pointer attribute.A pointer is associated with a target by allocation
or pointer assignment
具有target属性的变量,可以用指针指向该变量
program mainimplicit noneinteger,pointer ::a=>null(),b=>null()integer,target ::cinteger ::d c=1 print*,associated(a) a=>c c=2 b=>c d=a+b print*,associated(a) print*,a,b,c,dend
输出 2 2 2 4
The associated intrinsic returns the association status of a pointer variable
associated返回T or F,如果指针已与变量关联返回T,否则返回F
integer , pointer :: a=>null(),b=>null()
allocate(a)
a = 1
如果我们没有allocate a那么对a进行赋值是非法的
program mainimplicit noneinteger,pointer ::a=>null(),b=>null()integer,target ::cinteger ::d allocate(a) allocate(b) a=100 b=200 print*,a,b c=1 a=>c c=2 b=>c d=a+b print*,a,b,c,dend
输出100 200
2 2 2 4
ALLOCATE ( allocation-list [ , STAT = stat-variable ] )
If the STAT= specifier is present, successful execution of the ALLOCATE statement causes the stat-variable to
become defined with a value of zero. If an error condition occurs during the execution of the ALLOCATE
statement, the stat-variable becomes defined with a processor-dependent positive integer value.
References
Ian Chivers / Jane Sleightholme
Introduction to Programming with Fortran-With Coverage of Fortran 90, 95, 2003, 2008 and 77
f90 stanard:http://www.fortran.com/f90_std.pdf
- fortran指针
- Fortran中的指针使用
- Fortran指针初探
- Fortran指针再探
- Fortran
- fortran
- fortran
- 【旧代码】fortran中的指针实现链表的代码
- 什么是Fortran
- Fortran FAQ
- FORTRAN简介
- fortran教程
- fortran简介
- Fortran接口
- Fortran接口
- Fortran 数组
- OpenMP & Fortran
- fortran学习
- 重新起步
- 等你爱我的伤感QQ日志:听说,喜欢隐身的人都有一种伤
- OpenStack命令大全
- 中欧遥感科技合作:“龙”观天下还看雷达
- 技巧—PHP开发提高效率技巧(转载)
- fortran指针
- 一些css功能
- 求全排列(可重复)next_permutation
- 清华一游
- SQL Server连接Oracle详细步骤
- 用VHDL和原理图输入进行CPLD/FPGA设计的粗略比较
- 图论--SPFA算法---邻接表实现
- CListCtrl使用技巧(加深篇)
- float 解析