| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 757 人关注过本帖
标题:这个头文件怎么回事???
取消只看楼主 加入收藏
tianqiao
Rank: 2
等 级:论坛游民
帖 子:80
专家分:55
注 册:2011-9-21
结帖率:85.71%
收藏
已结贴  问题点数:20 回复次数:0 
这个头文件怎么回事???
先上代码;
程序代码:
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
int main()
{
    unsigned long *primes=NULL;       

    unsigned long trial=0;             

    bool found =false;
    size_t total=0;
    size_t count=0;
    printf("how many numbers you want to get?you'll get at least 4 numers\n");
    scanf("%u",&total);
    total=total<4U?4U:total;
    primes=(unsigned long *)malloc(total*sizeof(unsigned long));
    if(primes==NULL)
    {
        printf("\nnot enough memory.\n");
        return 1;
    }
    *primes=2UL;
    *(primes+1)=3UL;
    *(primes+2)=5UL;
    count=3U;
    trial=5U;

    while(count<total)
    {
        trial+=2UL;

        for(size_t i=0;i<count;i++)
            if(!(found=(trial%*(primes+i))))
                break;
        if(found)
            *(primes+count++)=trial;
    }
   


    for(size_t i=0;i<total;i++)
    {
        if(!(i%5U))
            printf("\n");
        printf("%12lu",*(primes+i));
    }
    printf("\n");
    return 0;
}
这是书上的原文,结果编译时候显示"无法打开包括文件:“stdbool.h”: No such file or directory".求解
搜索更多相关主题的帖子: color 
2011-12-31 20:36
快速回复:这个头文件怎么回事???
数据加载中...
 
   



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

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