你会如何​​变量设置为最大数可能用C? [英] How would you set a variable to the largest number possible in C?

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

问题描述

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


解决方案

 的#include<&limits.h中GT;
INT X = INT_MAX;

编辑:前提问澄清,我只是猜测他们想要的是什么类型的回答

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

解决方案

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

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

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

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