external declarations of ptrs and arrays

George Turczynski george at hls0.hls.oz
Fri Aug 3 09:04:34 AEST 1990


In article <364 at taumet.com>, steve at taumet.com (Stephen Clamage) writes:
>
> ...
>
> "char *temp[20];" means "temp is the first address of an array of 20 chars".
>
> ...

What ???

Don't you mean "char *temp[20];" means "temp is the first address of an array of 20 (char *) (pointers)."

Your description implies that 20 bytes of storage are used, but I think you'll find it is very different in reality !

Try this:

/* Cut here */

#include<stdio.h>

char	*temp[20];

main()
{
	fprintf(stderr,"Size of temp is %d.\n",sizeof(temp));

	exit(0);
}

/* Cut here */

This should prove to you that what you said is WRONG.

George P. J. Turczynski.          | ACSnet: george at highland.oz
                                  | Phone: 61 48 683490
Computer Systems Engineer.        | Fax:   61 48 683474
                                  |----------------------
Highland Logic Pty. Ltd.          | I can't speak for the
Suite 1, 348-354 Argyle Street    | company, I can barely
Moss Vale. NSW. 2577 Australia    | speak for myself...



More information about the Comp.lang.c mailing list