您如何将变量设置为 C 中可能的最大数字? [英] How would you set a variable to the largest number possible in C?

查看:11
本文介绍了您如何将变量设置为 C 中可能的最大数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 C 中将变量设置为等于无穷大(或任何保证的最大数值)?

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

推荐答案

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

在提问者澄清之前回答,我只是在猜测他们想要什么类型.

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

这篇关于您如何将变量设置为 C 中可能的最大数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆