Determine the name of a constant based on the value

后端 未结 7 924
广开言路
广开言路 2021-01-05 22:07

Is there a way of determining the name of a constant from a given value?

For example, given the following:

public const uint ERR_OK = 0x00000000;

Ho

7条回答
  •  伪装坚强ぢ
    2021-01-05 22:29

    I don't think you can do that in a deterministic way. What if there are multiple constants with the same value?

提交回复
热议问题