Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] C puzzle
- Date: Mon, 29 Jul 2002 21:52:49 -0400
- From: Viktor Pavlenko <vvp@example.com>
- Subject: Re: [tlug] C puzzle
- References: <20020726012006.M48242-100000@example.com><15680.11598.642676.889439@example.com><1027725222.13382.6.camel@example.com><m3d6t6xcn8.wl@example.com>
>>>>> "MB" == Masato BITO <masato.bito@example.com> writes: MB> At 27 Jul 2002 08:13:41 +0900, MB> bruno raoult wrote: >> How to get 1? (Ooops. Sorry for this one!) MB> main() { MB> int*i, n=20; MB> for(i = 0 ; i < n ; i--) MB> printf("-"); MB> } MB> Is it correct? I don't think this one satisfies the original request to turn the sample into a "correct C program". The original code is much more correct than your solution:) Nevertheless it works (despite of gcc complaints). I think it's because the pointer to int is unsigned, so negating it results in a big positive number. Correct me if I'm wrong. Viktor
- Follow-Ups:
- Re: [tlug] C puzzle
- From: Josh Glover
- References:
- [tlug] C puzzle
- From: Tod McQuillin
- Re: [tlug] C puzzle
- From: Viktor Pavlenko
- Re: [tlug] C puzzle
- From: bruno raoult
- Re: [tlug] C puzzle
- From: Masato BITO
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] C puzzle
- Next by Date: [tlug] ISDN connection woes
- Previous by thread: Re: [tlug] C puzzle
- Next by thread: Re: [tlug] C puzzle
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links