cintegerlimits

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


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


Solution

  • #include <limits.h>
    int x = INT_MAX;
    

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