2 * - dereference or indirection operator
13 When used as a binary operator, '*' performs multiplication. When
14 used as a operator, '*' returns the value at a given address.
16 If X is an address, *X returns the value at that address. This value
17 will be an octet, lvalue, string, or number, depending on the
18 type of address. Thus, for any addressable A, *&A is the same as A.
20 If X is an lvalue, *X returns the current value at the address
21 considered to be specified by X. This value may be an lvalue or
22 octet, in which cases, for most operations except when X is the
23 destination of an assignment, *X will contribute the same as X to
24 the result of the operation. For example, if A and B are lvalues
25 whose current values are numbers, A + B, *A + B, A + *B and *A + *B
26 will all return the same result. However if C is an lvalue and A is
27 the result of the assignment A = &C, then A = B will assign the value
28 of B to A, *A = B will assign the value of B to C without affecting
31 If X is an lvalue whose current value is a structure (matrix, object,
32 list, or association), the value returned by *X is a copy of the
33 structure rather than the structure identified by X. For example,
34 suppose B has been created by
42 will assign the values 4,5,6 to the elements of a copy of B, which
43 will then become the value of A, so that the values of A and B will
44 be different. On the other hand,
48 will result in A and B having the same value.
50 If X is an octet, *X returns the value of that octet as a number.
52 The * operator may be iterated with suitable sequences of pointer-valued
53 lvalues. For example, after
59 **c returns the lvalue a; ***c returns the value of a.
64 ; print *p, *(p + 1), *(p + 2)
85 ## Copyright (C) 1999-2006 Landon Curt Noll
87 ## Calc is open software; you can redistribute it and/or modify it under
88 ## the terms of the version 2.1 of the GNU Lesser General Public License
89 ## as published by the Free Software Foundation.
91 ## Calc is distributed in the hope that it will be useful, but WITHOUT
92 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
93 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
94 ## Public License for more details.
96 ## A copy of version 2.1 of the GNU Lesser General Public License is
97 ## distributed with calc under the filename COPYING-LGPL. You should have
98 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
99 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
101 ## @(#) $Revision: 30.1 $
102 ## @(#) $Id: dereference,v 30.1 2007/03/16 11:10:42 chongo Exp $
103 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/dereference,v $
105 ## Under source code control: 1997/09/06 20:03:34
106 ## File existed as early as: 1997
108 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
109 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/