Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #1903

Re: repeating something n times

From "Charles Richmond" <numerist@aquaporin4.com>
Newsgroups comp.programming
Subject Re: repeating something n times
Date 2012-07-06 07:16 -0500
Organization A noiseless patient Spider
Message-ID <jt6kvi$7ah$1@dont-email.me> (permalink)
References <repeat-20120705210751@ram.dialup.fu-berlin.de>

Show all headers | View raw


"Stefan Ram" <ram@zedat.fu-berlin.de> 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.

--

numerist at aquaporin4 dot com 

Back to comp.programming | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: repeating something n times "Charles Richmond" <numerist@aquaporin4.com> - 2012-07-06 07:16 -0500
  Re: repeating something n times Ike Naar <ike@sverige.freeshell.org> - 2012-07-06 12:57 +0000

csiph-web