变量最大值及字节数

变量最大值及字节数
#include "iostream"
#include "climits"
int main(){
    using namespace std;
    int n_int = INT_MAX;
    long long n_llong = LLONG_MAX;
    cout << "int is " << sizeof (int) << " bytes." << endl;
    cout << "long long is " << sizeof n_llong << " bytes." << endl;
    cout << "MAX int value is " << n_int << endl;
    cout << "Bits per byte = " << CHAR_BIT << endl;
    return  0;
}

posted @ 2021-12-06 20:43  ayanyuki  阅读(43)  评论(0)    收藏  举报