Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!brl-tgr!ron
From: ron@brl-tgr.ARPA (Ron Natalie )
Newsgroups: net.lang.c
Subject: Re: C programming hint
Message-ID: <11516@brl-tgr.ARPA>
Date: Thu, 11-Jul-85 17:56:31 EDT
Article-I.D.: brl-tgr.11516
Posted: Thu Jul 11 17:56:31 1985
Date-Received: Sat, 13-Jul-85 12:04:34 EDT
References: <899@teddy.UUCP>
Organization: Ballistic Research Lab
Lines: 16


> I found a way to initialize an array of characters without using a loop.
> Here is the method I used:
> 
> 	strncpy(blanks + 1, blanks, SIZE - 1);	/* initialize entire array */
> 		   ^^^       ^^^       ^^^
> The trick is to use strncpy in an almost recursive way.

We call this "almost recursion" iteration, and all it does is hide the
loop in the strncpy function.

> Well, I hope you found this useful.

No, not really.

-Ron