9.167. LOC

9.167 LOC — Returns the address of a variable

Description:
LOC(X) returns the address of X as an integer.
Standard:
GNU extension
Class:
Inquiry function
Syntax:
RESULT = LOC(X)
Arguments:
X Variable of any type.
Return value:
The return value is of type INTEGER, with a KIND corresponding to the size (in bytes) of a memory address on the target machine.
Example:
program test_loc
  integer :: i
  real :: r
  i = loc(r)
  print *, i
end program test_loc

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gfortran/LOC.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部