• Welcome to Valhalla Legends Archive.
 

Compiler issues?

Started by Eli_1, February 16, 2004, 03:27 PM

Previous topic - Next topic

Eli_1

#15
I ment more along the lines of how will the two outputs differ...  because the latter code works and it all sends properly, but sprintf() doesn't. :P

Skywing

Quote from: Zakath on February 17, 2004, 04:13 PM
Less overhead, you're only making 1 function call instead of 2. Any time you can cut down on the number of different functions that need to be loaded into memory, you're improving the efficiency of your program.
Not true.  If you have a large section of code that is used lots, it's better to put it in it's own function.

Adron

Quote from: Zakath on February 17, 2004, 04:13 PM
Less overhead, you're only making 1 function call instead of 2. Any time you can cut down on the number of different functions that need to be loaded into memory, you're improving the efficiency of your program.

Yes, obviously it's always better to load one 10 kb function than two 100 byte ones.

Zakath

Well, within reason, of course.  Assuming, though, that you have some well-defined goal, and that there are two ways to do it: one with one function, and one with two. Generally I wouldn't expect the actual amount of code necessary to accomplish the goal to be much different, so using a single function has the advantage.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Adron

Well, what we were talking about here was whether to use strcpy and strcat or to use sprintf... At least that was the question you replied to. Nothing about writing your own functions in that post as far as I can see. And choosing between those, I think using strcpy and strcat is the more efficient choice for a small program.

Eli_1

well considering that's the only one that works, I'll go with that one... thanks ;D