Re: <ctype.h> toLower()
From: Richard Heathfield (dontmail_at_address.co.uk.invalid)
Date: 12/05/03
- Next message: Greg Comeau: "Re: some general questions"
- Previous message: Jumbo: "Re: <ctype.h> toLower()"
- In reply to: Jumbo: "Re: <ctype.h> toLower()"
- Next in thread: Jumbo: "Re: <ctype.h> toLower()"
- Reply: Jumbo: "Re: <ctype.h> toLower()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 5 Dec 2003 18:39:29 +0000 (UTC)
Jumbo wrote:
> "Richard Heathfield" <dontmail@address.co.uk.invalid> wrote in message
> news:bqp9kj$fc$1@sparta.btinternet.com...
>> Jumbo wrote:
>> >
>> > I tested it on my PC and it was twice as fast and has no overheads.
>>
>> If you're still talking about your loop-test-with-strlen-call
>> code, you must have a really strange machine.
>
> No the strlen in the loop is not an example that has been made efficient.
> That was just demonstrating one way of many.
There are many trillions of different ways to demonstrate any demonstrable
computing task. To attempt to demonstrate them all is clearly futile, so it
makes sense to concentrate on the good ways.
>> > I'm not saying it will work in every case, but there is nothing
>> > wrong with doing it if you want too.
>>
>> When there is a method that /will/ work in every case, and
>> when that method is easier to remember, easier to code,
>> quicker to code, and quicker to run, I reckon there /is/
>> something wrong with rejecting that other method in
>> favour of a method that is clearly broken.
>
> It's not quicker to run on every implementation , maybe it is if a lookup
> array is used but then your incurring the overhead of the array.
So you concede (by your lack of objection) that it will work in every case,
is easier to remember, easier to code, and quicker to code?
>> > If I want to do this I can:
>> > ......
>> > char ch= 'a';
>> > for(int i=0; i<26; i++)
>> > {
>> > std::cout << ch << " ";
>> > ch++;
>> > }
>> > ......
>> >
>> > The output of this is not the same on every machine so
>> > according some this means code is non compliant.
>>
> No it doesn't rely on anything imagine it is part of a windows program.
If you want to discuss Windows programming, there are newsgroups available
for that kind of discussion. Here, we discuss C and C++, not "stuff that
happens to work on my platform".
-- Richard Heathfield : binary@eton.powernet.co.uk "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999. C FAQ: http://www.eskimo.com/~scs/C-faq/top.html K&R answers, C books, etc: http://users.powernet.co.uk/eton
- Next message: Greg Comeau: "Re: some general questions"
- Previous message: Jumbo: "Re: <ctype.h> toLower()"
- In reply to: Jumbo: "Re: <ctype.h> toLower()"
- Next in thread: Jumbo: "Re: <ctype.h> toLower()"
- Reply: Jumbo: "Re: <ctype.h> toLower()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|