Const vs Define
#6

Quote:
Originally Posted by milanosie
Посмотреть сообщение
Say that again please, and now with thinking before you say it.
Definitions don't use memory?
Oh really? Explain me why you think that something doesn't use/require resources, I'll be glad to hear.
I confess that I am not that strong in that part of programming, you can say what ever you want and I will not be able to say much agaiinst it.

I see definitions work this way.
Код:
#define NUMBER_ONE 1
Once program sees NUMBER_ONE in code it checks #define line and replaces it with the word(s) that are coming after second one(in this case NUMBER_ONE)
You can still think program is using some variables to do that.
Then, I will have to do this code
Код:
#define abs(%0) (%0<0)?(-%0):%0 // I think this code is okay.
in this example, I don't think program will use variables to store the valuse etc. I think, it will just look #define line and replace it with the following code.
Reply


Messages In This Thread
Const vs Define - by Finn - 13.07.2012, 18:08
Re: Const vs Define - by Vince - 13.07.2012, 18:30
Re: Const vs Define - by Roko_foko - 13.07.2012, 18:47
Re: Const vs Define - by milanosie - 13.07.2012, 18:50
Re: Const vs Define - by Finn - 13.07.2012, 18:57
Re: Const vs Define - by Roko_foko - 13.07.2012, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)