| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 759 人关注过本帖
标题:求极限值。
只看楼主 加入收藏
magina_hh
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-7-25
结帖率:80%
收藏
已结贴  问题点数:20 回复次数:1 
求极限值。
我是个刚学C语的菜鸟。

我想请问下下面这段代码哪里有错误。

#include <stdio.h>        /* For command line input and output */
#include <limits.h>        /* For limits on integer types */
#include <float.h>        /* For limits on floating-point types */

int main(void)

{

    printf("Variables of type char store values from %d to %d",
            CHAR_MIN,CHAR_MAX);
    printf("\nVariables of type unsigned char store values from 0 to %u",
            UCHAR_MAX);
    printf("\nVariables of type short store values from %d to %d",
            SHRT_MIN,SHRT_MAX);
    printf("\nVariables of type unsigned short store values from 0 to %u",
            USHRT_MAX);
    printf("\nVariables of type int store values from %d to %d",
            INT_MIN,INT_MAX);
    printf("\nVariables of type unsigned int store values from 0 to %u",
            UINT_MAX);
    printf("\nVariables of type long store values from %ld to %ld",
            LONG_MIN,LONG_MAX);
    printf("\nVariables of type unsigned long store values from 0 to %lu",
            ULONG_MAX);
    printf("\nVariables of type long long store values from %lld to %lld",
            LLONG_MIN,LLONG_MAX);
    printf("\nVariables of type unsigned long long store values from 0 tu %llu",
            ULLONG_MAX);
    printf("\n\nThe size of the smallest non-zero value of type float is %.3e",
            FLT_MIN);
    printf("\nThe size of the largest value of type float is %.3e",
            FLT_MAX);
    printf("\nThe size of the smallest non-zero value of type double is %.3e,
            DBLE_MIN);
    printf("\nThe size of the largest value of type double is %.3e",
            DBL_MAX);
    printf("\nThe size of the smallest non-zero value ~CCC of type long double is %.3Le",
            LDBL_MIN);
    printf("\nThe size of the largest value of type long double is %.3Le\n",
            LDBL_MAX);
    printf("\nVariables of type float provide %u decimal digits precision.",
            FLT_DIG);
    printf("\nVariables of type double provide %u decimal digits precision.",
            DBL_DIG);
    printf("\nVariables of type long double provide %u decimal digits precision.",
            LDBL_DIG);

    return 0;

}


他的错误提示是
--------------------Configuration: 自学15 - Win32 Debug--------------------
Compiling...
自学15.c
c:\documents and settings\administrator\桌面\自学15.c(26) : error C2065: 'LLONG_MIN' : undeclared identifier
c:\documents and settings\administrator\桌面\自学15.c(26) : error C2065: 'LLONG_MAX' : undeclared identifier
c:\documents and settings\administrator\桌面\自学15.c(28) : error C2065: 'ULLONG_MAX' : undeclared identifier
c:\documents and settings\administrator\桌面\自学15.c(33) : error C2001: newline in constant
c:\documents and settings\administrator\桌面\自学15.c(34) : error C2146: syntax error : missing ')' before identifier 'DBLE_MIN'
c:\documents and settings\administrator\桌面\自学15.c(34) : error C2059: syntax error : ')'
执行 cl.exe 时出错.

自学15.obj - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: 极限值 
2009-08-03 23:00
prankmoon
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:161
专家分:921
注 册:2009-7-21
收藏
得分:20 
把下面这两行删掉:
   printf("\nVariables of type long long store values from %lld to %lld",
            LLONG_MIN,LLONG_MAX);
    printf("\nVariables of type unsigned long long store values from 0 tu %llu",
            ULLONG_MAX);

应为 LLONG_MIN, LLONG_MAX和ULLONG_MAX没有定义。
2009-08-04 04:58
快速回复:求极限值。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024604 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved