Pointers 在Fortran 77中打印变量的地址

Pointers 在Fortran 77中打印变量的地址,pointers,printing,fortran77,Pointers,Printing,Fortran77,如何在Fortran 77中打印变量的地址?例如: subroutine foo integer d3 c Now I want to print "Address of d3: " followed by its address. 当然,C中的等价物是 int d3; printf("Address of d3: %p\n", &d3); 谢谢 虽然从技术上讲,Fortran 77并不适用,但大多数Fortran编译器都提供LOC函数来获取变量的地址 请参

如何在Fortran 77中打印变量的地址?例如:

      subroutine foo

      integer d3
c Now I want to print "Address of d3: " followed by its address.
当然,C中的等价物是

int d3;
printf("Address of d3: %p\n", &d3);

谢谢

虽然从技术上讲,Fortran 77并不适用,但大多数Fortran编译器都提供LOC函数来获取变量的地址


请参阅:

谢谢!我实际上知道loc函数,但只在Cray指针的上下文中看到它,不知道如何使用它来打印地址。您提到的页面有一个有用的示例。