C declarations

MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA
Wed Feb 13 19:06:06 AEST 1985


	the declaration:

	funct()
	{
		type var[];
	...
	}

is declaring a null array (probably one element actually allocated).
using the name var will produce a constant(!) address/ptr to this
mythological location.

	the declaration:

	funct()
	{
		type *var;
		...
	}

allocates a location var the contents of which is a ptr to type.
using var returns the contents of the location which can then be used
as the ptr to the variable pointed to.

	does this help define the usage of var[] and *var more
clearly?  i hope so.

                      shades%mit-oz at mit-mc.arpa



More information about the Comp.lang.c mailing list