Re: Scalar Pointers Pointing at Array Elements



Richard Maine <nospam@xxxxxxxxxxxxx> wrote:
(snip)

1. When you allocate a pointer, the allocated entity has the target
attribute and thus can be pointed at. That might seem almost a
tautology, but it is a point that has been known to confuse people (such
as me; it was a long time ago, but I do recall once being confused).
After all, the keyword TARGET doesn't appear anywhere; there is only the
keyword pointer. The perhaps subtle distinction is that, although the
pointer doesn't (and can't) have the target attribute, when you allocate
a pointer, that anonymous allocated thing does have the target
attribute.

But one might want to point at a pointer, and not just to the
target of the pointer. That seems much more common in C, though.

-- glen
.



Relevant Pages

  • Re: Pointers allocation/deallocation
    ... It is processor dependent. ... If the dummy argument has the TARGET attribute and ... pointer association status of any pointer that is ...
    (comp.lang.fortran)
  • Re: association with zero-length array?
    ... Requirements for pointer and target association ... POINTER attribute, TARGET attribute, pointer association ... If PTR has the POINTER attribute and TGT has the TARGET or ... and TGT considered to be pointer associated, i.e., under which of the ...
    (comp.lang.fortran)
  • Re: Target attribut for derived type component
    ... involving either target attributes or default ... One thing I am testing out is singly linked lists. ... as the list head, normally called a sentinel. ... order to have this node be the target of a pointer it must have either ...
    (comp.lang.fortran)
  • Re: TARGET and INTENT(IN)
    ... you can use a pointer to point at something and then modify it through the pointer. ... A pointer is very much like a dummy argument. ... With this meaning of "TARGET" for INTENTdummys I don't see the point - the compiler still doesn't do anything different than for INTENTdummys without TARGET. ... I've been known to have wrapper routines that try to make life simpler for both the routines that calls them and the lower-level routines that they call. ...
    (comp.lang.fortran)
  • Re: Target attribut for derived type component
    ... involving either target attributes or default ... One thing I am testing out is singly linked lists. ... order to have this node be the target of a pointer it must have either ... However if this dummy has the ...
    (comp.lang.fortran)