changing const int value in library header file

A

aryan

Hi,

I need to change the value of a const int variable defined in the
header file of a library. The variable is used to dynamically set size
of a char buffer within a class of the library. Its not used anywhere
else. It seems to work without recompiling atleast one application.
Would it work with other applications without recompiling?

thnx in advance
 
D

dizzy

aryan said:
Hi,

I need to change the value of a const int variable defined in the
header file of a library. The variable is used to dynamically set size
of a char buffer within a class of the library. Its not used anywhere
else. It seems to work without recompiling atleast one application.
Would it work with other applications without recompiling?

Depends on how it was defined (in a header or a separate cpp file),
toolchain, optimization flags details. Because a "const int" may be
completely compile time optimized out (that is where you use it the
compiler may directly put the value as of a "#define") instead of really
refer to some storage where the value is stored.
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top