How are C# const members allocated in memory? [duplicate]
问题 This question already has an answer here : Memory allocation for const in C# (1 answer) Closed 6 years ago . The title of the question is self explanatory. I wonder if a member that is declared const is singleton for all instances of the class or each instance has it's own copy. I've read some questions about const but most of them refer to const variables inside a method. 回答1: Constants are usually something that can be evaluated compile time and compiler is likely to replace it with the