TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: neil Heller
from: Bill Birrell
date: 2004-04-14 07:16:00
subject: cli

as a trivial example of the less easy to optimise loops:-

#include 
int main( int argc, char *argv[])
{   auto int n,count;
    for(count = 0; count < argc; count++)
        for(n = 0; n < strlen(argv[count]); n++)
            putc(argv[count][n],stdout);
    return 0;
}

    Here strlen() changes intentionally each iteration. The code is also
pretty dreadful because printf(" %s\n",argv[count]) would work
and look better.

    I guess it's a loophole, Neil. :-)

Best Wishes,
Bill.

---
* Origin: Escan BBS (2:25/200)
SEEN-BY: 633/267 270
@PATH: 25/200 108 252/110 250/501 140/1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.