address of function

D. Chadwick Gibbons chad at lakesys.UUCP
Tue Jun 13 15:47:53 AEST 1989


In article <370 at msor0.UUCP> kt at msor0.UUCP (Keith Tizzard) writes:
| ... and does ANSI permit the following ?
|	int	this[100], *that = &this;

	Not exactly; more like:

	int this[100], *that = this;

		-or-

	int this[100], *that = &this[0];

As with a function, the name by itself implies the address of the first
element of the array.  To specify a different element as the location for
your pointer, you must use the second form, and specify the array bounds
as you require.
-- 
D. Chadwick Gibbons, chad at lakesys.lakesys.com, ...!uunet!marque!lakesys!chad



More information about the Comp.lang.c mailing list