C programming hint

Peter da Silva peter at baylor.UUCP
Thu Jul 25 07:21:50 AEST 1985


> In article <913 at teddy.UUCP> kps at teddy.UUCP writes:
> >
> >	char blanks[SIZE];
> >	blanks[0] = ' ';
> >	strncpy(blanks + 1, blanks, SIZE - 1);	/* initialize entire array */
> >
> > ... I've been bludgeoned to death with the fact that my method is
> > implementation dependent and that it won't work all the time.
> 
> This actually works in assembly language for the PDP-10.
> 
And of course it's the STANDARD method of initialising an array in FORTH:

	: fill over c! dup 1+ cmove ;
-- 
	Peter da Silva (the mad Australian)
		UUCP: ...!shell!neuro1!{hyd-ptd,baylor,datafac}!peter
		MCI: PDASILVA; CIS: 70216,1076



More information about the Comp.lang.c mailing list