Can const member variable of class be initialized in a method instead of constructor?

前端 未结 5 1085
南方客
南方客 2021-02-10 07:56

I have a class and want to create a const int variable but the value for the variable is not available to me in constructor of the class.

In initialization method of the

5条回答
  •  执笔经年
    2021-02-10 08:24

    I think I need to change the design and I should calculate the (or get) the const variables value at constructor any how. As there is no way I can set it's value later.

提交回复
热议问题