| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 720 人关注过本帖
标题:找下错误
只看楼主 加入收藏
Zzz2618655
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2011-7-5
结帖率:33.33%
收藏
已结贴  问题点数:6 回复次数:4 
找下错误
/* program 2.11 finding the limits */
#include<stdio.h>
#include<limits.h>
#include<float.h>

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 form 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 unsignes long long store values from 0 to %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",DBL_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 %.3e",LDBL_MIN);
    printf("\nthe size of the largest value of type long double is %.3e\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: find min or max - Win32 Debug--------------------
Compiling...
find min or max.c
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(16) : error C2065: 'LLONG_MIN' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(16) : error C2065: 'LLONG_MAX' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(17) : error C2065: 'ULLONG_MAX' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(24) : error C2143: syntax error : missing ')' before 'constant'
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(24) : error C2059: syntax error : ')'
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(25) : error C2143: syntax error : missing ')' before 'constant'
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(25) : error C2059: syntax error : ')'
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(26) : error C2143: syntax error : missing ')' before 'constant'
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(26) : error C2059: syntax error : ')'
执行 cl.exe 时出错.

find min or max.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: finding include limits values store 
2011-08-09 16:13
NtianX
Rank: 1
等 级:新手上路
帖 子:9
专家分:7
注 册:2011-4-29
收藏
得分:3 
#include<stdio.h>
#include<limits.h>
#include<float.h>

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 form 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 unsignes long long store values from 0 to %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",DBL_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 %.3e",LDBL_MIN);
    printf("\nthe size of the largest value of type long double is %.3e\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;
}
修正后的源代码
2011-08-09 16:28
Zzz2618655
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2011-7-5
收藏
得分:0 
哪里错了能标出来吗?下面我知道是逗号漏下了
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(16) : error C2065: 'LLONG_MIN' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(16) : error C2065: 'LLONG_MAX' : undeclared identifier
C:\Documents and Settings\Administrator\桌面\c\2\2.11\find min or max.c(17) : error C2065: 'ULLONG_MAX' : undeclared identifier
这3个错误怎么改
2011-08-09 20:33
Zzz2618655
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2011-7-5
收藏
得分:0 
不行吧
2011-08-09 20:45
小曹
Rank: 2
等 级:论坛游民
帖 子:8
专家分:24
注 册:2010-3-8
收藏
得分:3 
剩下的三个错误你看看是不是你的编译器的问题 , LLONG_MAX , LLONG_MIN , ULLONG_MAX,这些宏定义 只有在支持C99标准的编译器中才可以通过,希望对你有用!!如果是vc6.0的话很可能就是这样。
2011-08-09 20:47
快速回复:找下错误
数据加载中...
 
   



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

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