Pointers and references: Difference between revisions

Content added Content deleted
m (→‎{{header|Fortran}}: Fixed typo (existance → existence))
Line 529: Line 529:
pointertoreal => areal</lang>
pointertoreal => areal</lang>


The target attribute is needed to say that the ''object'' (the "real" datum) can be referenced through a pointer (it seems it works more like an alias rather than a "true" pointer). The existance of an ''association'' can be tested with <tt>associated</tt> (Fortran 95):
The target attribute is needed to say that the ''object'' (the "real" datum) can be referenced through a pointer (it seems it works more like an alias rather than a "true" pointer). The existence of an ''association'' can be tested with <tt>associated</tt> (Fortran 95):


<lang fortran>if ( associated(pointertoreal) ) !...</lang>
<lang fortran>if ( associated(pointertoreal) ) !...</lang>