Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 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 函数来获取变量的地址。
见: http: //gcc.gnu.org/onlinedocs/gfortran/LOC.html