How would you set a variable to the largest number possible in C?

前端 未结 10 617
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-01 17:53

How would you set a variable to equal infinity (or any guaranteed largest number value) in C?

10条回答
  •  [愿得一人]
    2020-12-01 18:45

    #include 
    int x = INT_MAX;
    

    EDIT: answered before the questioner clarified, I was just guessing what type they wanted.

提交回复
热议问题