A variable that is read-only after assignment at run-time?

后端 未结 4 1031
小蘑菇
小蘑菇 2021-02-06 05:22

Fairly new programmer here, and an advance apology for silly questions.

I have an int variable in a program that I use to determine what the lengths of my a

4条回答
  •  轮回少年
    2021-02-06 06:04

    When exactly do you know the correct value? If you read it from a file or whatever, you can just say:

    const int n = determine_correct_value();
    

提交回复
热议问题