| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | For loops in C... |
Hi Bob BL> This came out of a tight loop (zmodem?) where I was calling a BL> function in Pascal several times and Paul was using a macro... BL> The Pascal approach ran at HALF speed. When I changed my BL> function to code written several times as you suggest, it was BL> as fast as C and five-times as messy. Calling the function was BL> taking most of the time. RM> Declare the function "inline". Neat, fast, takes a bit more RM> space in the exe. BL> In C, or Pascal? C. I don't do Pascal. BL> Isn't that what a macro does in C anyway? yes, but the compiler can give more meaningful error messages BL> I can't see much point in using the inline directive in Pascal, BL> unless it is doing the code wrong or you have a specific instruction BL> you want inserted right there. Mostly, the Pascal compiler writes what BL> I would have written inline anyway. er.. does inline mean the same in Pascal as it does in C? In C, it means that when you write a function call, like z = add_numbers(x,y); then instead of placing a call to the function add_numbers() at that point, the compiler writes a complete copy of the code for add_numbers, eliminating the function call. Cheers --- PPoint 1.88* Origin: Silicon Heaven (3:711/934.16) SEEN-BY: 711/934 712/610 624 @PATH: 711/934 |
|
| 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™.