Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
I am working on a system where I need to provide access to a variable defined in one module to several other modules. However, these modules should only be able to see the value of the variable whereas the module in which it is defined needs to be able to modify it. Due to performance considerations, a wrapper function that returns the value of the variable is not an option - this variable needs to be queried millions of times. Does anyone have any ideas how to do this? Is there any smart way to declare the variable as const and then 'cast away' the const in the module?
Thanks,
SS
Note: This is C-specific and I cannot use C++ to do this.
I am working on a system where I need to provide access to a variable defined in one module to several other modules. However, these modules should only be able to see the value of the variable whereas the module in which it is defined needs to be able to modify it. Due to performance considerations, a wrapper function that returns the value of the variable is not an option - this variable needs to be queried millions of times. Does anyone have any ideas how to do this? Is there any smart way to declare the variable as const and then 'cast away' the const in the module?
Thanks,
SS
Note: This is C-specific and I cannot use C++ to do this.