Home > Fortran > Pointers

Pointers

Related Categories

F90 pointers  
Most scientific programs involve large amounts of data that the programmer is called upon to manage. If space is a problem, and it often is, using space efficiently becomes important. A pointer facility makes it possible to do this with efficiency and clarity. Versions of Fortran at most installations running large data codes have some form of pointers and a set of related memory-management functions as extensions to FORTRAN 77; the Cray pointer facility is one of these extensions. A pointer facility is also included in the Fortran 90 standard. However, Cray pointers are not like Fortran 90 pointers. While converting from Cray pointers to Fortran 90 pointers is possible, you will have to modify your existing programs to conform with the Fortran 90 standard. FORTRAN 77 did not have a pointer facility, and Cray pointers were added as an extension responding to user needs at the time.
Submitted: Mar 29, 2000
cnf_cptr - Convert a FORTRAN pointer to a C pointer  
Given a FORTRAN pointer, stored in a variable of type F77_POINTER_TYPE, this function returns the equivalent C pointer. Note that this conversion is only performed if the C pointer has originally been registered (using cnf_regp) for use from both C and FORTRAN. All pointers to space allocated by cnf_calloc and cnf_malloc are automatically registered in this way.
Submitted: Mar 29, 2000



  Privacy - Trademarks - Feedback - Terms of Use Copyright The MathWorks, Inc.