Const object takes memory?

  • Thread starter Thread starter Tomer
  • Start date Start date
T

Tomer

Hi,
When I define a const, does it takes memory in run time, or does the
compiler replace the code where I've used the const var, and then compile
the program?

Tomer.
 
The compiler should replace the constant's value in the IL wherever the
const variable is used. Just compile your code with and without the const
keyword and observe the differences in IL using ILDASM

Cheers
Daniel
 
Thanks!

Tomer.


Daniel Moth said:
The compiler should replace the constant's value in the IL wherever the
const variable is used. Just compile your code with and without the const
keyword and observe the differences in IL using ILDASM

Cheers
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Weird Behaviour of Compiler Directives? 14
Register HotKey 0
Const? 3
Establishing GPRS Connection on WM5 0
const 16
Cascading combos in datasheet 0
Passing method pointer 9
Compiler optimization? 1

Back
Top