Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Ike Naar Newsgroups: comp.programming Subject: Re: repeating something n times Date: Fri, 6 Jul 2012 12:57:19 +0000 (UTC) Organization: A noiseless patient Spider Lines: 23 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Date: Fri, 6 Jul 2012 12:57:19 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="mX321DN/BskaPeu9dpMNqQ"; logging-data="17957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19J24xn5Qts2FfzQJxY9deB" User-Agent: slrn/0.9.9p1 (NetBSD) Cancel-Lock: sha1:tlMh1GptOzu9TIMHMZTNm2L09cc= Xref: csiph.com comp.programming:1904 On 2012-07-06, Charles Richmond wrote: > "Stefan Ram" wrote in message > news:repeat-20120705210751@ram.dialup.fu-berlin.de... >> It is funny how many languages fail to give a means to >> repeat something n times. >> >> In Logo, one can write: >> >> repeat 4 >> >> to repeat something 4 times, but in C one needs >> >> for( int i = 0; i < 3; ++i ) >> > > In C, you're gonna need: > > for(i = 0; i < 4; ++i) > > Where "i" is declared earlier. You can *not* declared "i" as integer... > within the for() of the statement. In C++ you can, but *not* in C. As from the 1999 C standard, you can.