Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #1973
| From | "io_x" <a@b.c.invalid> |
|---|---|
| Newsgroups | comp.programming |
| References | <repeat-20120705210751@ram.dialup.fu-berlin.de> <jt7jdv$247$1@dont-email.me> <b73472b3-9e35-45e4-b9cf-ab8366f4e770@googlegroups.com> <XZadncWsL_SNrJ_NnZ2dnUVZ_smdnZ2d@giganews.com> <5005b1c1$0$13270$4fafbaef@reader2.news.tin.it> |
| Subject | Re: repeating something n times |
| Date | 2012-07-18 14:19 +0200 |
| Message-ID | <5006a84a$0$13274$4fafbaef@reader2.news.tin.it> (permalink) |
| Organization | TIN.IT (http://www.tin.it) |
"io_x" <a@b.c.invalid> ha scritto nel messaggio
news:5005b1c1$0$13270$4fafbaef@reader2.news.tin.it...
>
> "Aaron W. Hsu" <arcfide@sacrideo.us> ha scritto nel messaggio
> news:XZadncWsL_SNrJ_NnZ2dnUVZ_smdnZ2d@giganews.com...
>> malcolm.mclean5@btinternet.com writes:
>>
>>> Bart writes:
>>
>>>>C is a good example where they seem to like redundancy (so you have to
>>>>write the loop-index 3 times even though it's never used).
>>
>>>That virtually never happens.
>>>Once in a blue moon you might need
>>
>>>/* Islamic divorce */
>>>for(i=0;i<3;i++)
>>> printf("I divorce you\n");
>>
>> In C, doing something like this, I would probably prefer the following:
>>
>> i = 0;
>> while (i++ < 3) printf("I divorce you.\n");
>
> #define F for
> F(i=0; i<3; ++i)
> printf("I divorce you.\n");
> it would write 0,1,2 [3 times ] the string...
>
>> Of course, more common for me are things like:
>>
>> while (NULL != x) *x++ = *y++;
>
> you suppose to write in [&x, (char*)-1]?
>
> could it be instead
> li: *x++ = *y++;
> if(*(x-1)) goto li;
> if language allow x,y can point to 1 pass the array
> of mem
> i not like while(), using for() i would write it as:
> F( ; *x++=*y++ ;)
>
> or
>
> while(*x++=*y++);
someone prefer
while( (*x++=*y++) !=0 );
where the 0 is (char)0 if suppose x and y point to array of chars...
so it is not NULL a pointer...
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-06 21:56 +0100
Re: repeating something n times Ben Bacarisse <ben.usenet@bsb.me.uk> - 2012-07-06 22:16 +0100
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-06 23:18 +0100
Re: repeating something n times malcolm.mclean5@btinternet.com - 2012-07-14 14:11 -0700
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-14 23:11 +0100
Re: repeating something n times Ike Naar <ike@iceland.freeshell.org> - 2012-07-14 23:37 +0000
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 01:16 +0100
Re: repeating something n times malcolm.mclean5@btinternet.com - 2012-07-14 17:35 -0700
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-14 22:23 -0500
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-14 22:19 -0500
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 11:00 +0100
Re: repeating something n times malcolm.mclean5@btinternet.com - 2012-07-14 17:44 -0700
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-14 22:17 -0500
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 11:49 +0100
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-15 09:53 -0500
Re: repeating something n times Rui Maciel <rui.maciel@gmail.com> - 2012-07-15 12:18 +0100
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 13:21 +0100
Re: repeating something n times Willem <willem@toad.stack.nl> - 2012-07-15 13:02 +0000
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 14:36 +0100
Re: repeating something n times Willem <willem@toad.stack.nl> - 2012-07-15 14:18 +0000
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 15:45 +0100
Re: repeating something n times Willem <willem@toad.stack.nl> - 2012-07-15 16:25 +0000
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 18:02 +0100
Re: repeating something n times Rui Maciel <rui.maciel@gmail.com> - 2012-07-15 15:10 +0100
Re: repeating something n times "BartC" <bc@freeuk.com> - 2012-07-15 16:10 +0100
Re: repeating something n times malcolm.mclean5@btinternet.com - 2012-07-15 13:00 -0700
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-14 21:55 -0500
Re: repeating something n times "io_x" <a@b.c.invalid> - 2012-07-17 20:47 +0200
Re: repeating something n times "io_x" <a@b.c.invalid> - 2012-07-18 14:19 +0200
Re: repeating something n times Aaron W. Hsu <arcfide@sacrideo.us> - 2012-07-18 12:55 -0500
Re: repeating something n times malcolm.mclean5@btinternet.com - 2012-07-18 11:57 -0700
csiph-web