| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 780 人关注过本帖
标题:c语言编译误
取消只看楼主 加入收藏
moshenglong
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2010-7-8
结帖率:57.14%
收藏
已结贴  问题点数:20 回复次数:3 
c语言编译误
#include <stdio.h>
#include <stdbool.h>
int main(void)
{
    char size[3] [12] = {
        {'6', '6', '6', '6', '7', '7', '7', '7', '7', '7', '7', '7'},
        {'1', '5', '3', '7', ' ', '1', '1', '3', '1', '5', '3', '7'},
        {'2', '8', '4', '8', ' ', '8', '4', '8', '2', '8', '4', '8'}
    };
    int headsize[12] =
    {164,166,169,172,175,178,181,184,188,191,194,197};
    float cranium = 0.0;
    int your_head = 0;
    int i = 0;
    bool hat_head = false;
    printf("\nEnter the circumferenec of your head above your eyebrows"
    "in inches as a decimal value:");
    scanf("%f", &cranium);
    your_head = (int) (8.0*cranium);
    for(i = 1; i < 12 ; i++)
    if(your_head > headsize)[i-1] && your_head <= headsize[i])
    {
        hat_head = true;
        break;
    }
    if(your_head == headsize[0])
    {
        i = 0;
        hat_head = true;
    }
    if(hat_head)
        printf("\nYour hat size is %c %c%c%c\n",
    size[0][i], size[1][i], (size[1][i] == ' ') ? ' ' : '/',
    size[2][i]);
    else
    {
        if(your_head < headsize[0])
            printf("\nYour are the proverbial pinhead. No hat for"
        "you I'm afraid.\n");
        else
            printf("\nYour, in technical parlance, are a fathead."
        "No hat for you, I'm afraid.\n");
    }
    return 0;
   
};
怎么用TC和VC都不能编译,都会报错,看了两天了,都没发现问题,麻烦哪位大哥指点一下,谢谢!
搜索更多相关主题的帖子: 编译 c语言 
2010-07-08 08:19
moshenglong
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2010-7-8
收藏
得分:0 
改了还是不行,现在是这样报错:Unable to open include file 'STDBOOL.H'
2010-07-09 18:28
moshenglong
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2010-7-8
收藏
得分:0 
请问一下stdbool.h头文件要怎么样才能找到
2010-07-09 18:29
moshenglong
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2010-7-8
收藏
得分:0 
还是不行,会报这个错:undefined symbols 'bool' in function  main
2010-07-09 19:16
快速回复:c语言编译误
数据加载中...
 
   



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

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