| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 7427 人关注过本帖
标题:我运用DEV-C++ 编写程序,在#include<stdafx.h>这里报错
取消只看楼主 加入收藏
sunshine萝卜
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-1-1
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
我运用DEV-C++ 编写程序,在#include<stdafx.h>这里报错
下面就是我的程序,如果加上 #include<stdafx.h> 显示 [Error] stdafx.h: No such file or directory
但是去掉的话,全篇程序都会出现问题,望大家给我指导一下,谢谢。

#include<stdafx.h>
#include<iostream>
using namespace std;

class Cylinder
{
    private:
        float radius,high;
    public:
        Cylinder(float r,float h);
        float Low Area(void);
        float Superficial Area(void);
        float Volume(void);
};

Cylinder::Cylinder(float r,float h):radius(r),high(h){
}

float Cylinder::Low Area(void){
    return 3.14*r*r;
}

float Cylinder::Superficial Area(void){
    return 2*3.14*r*r+(2*r*3.14)*h;
}

float Cyliner::Volume(void){
    return 3.14*r*r*h;
}

void main()
{
    float r,h;
    cout<<"输入圆柱的底面半径和高:";
    cin>>r>>h;
    Cyliner circle(r,h);
    cout<<"底面积为"<<circle.Low Area()<<endl;
    cout<<"表面积为"<<circle.Superficial Area()<<endl;
    cout<<"体积为"<<circle.Volume()<<endl;
   
    System ("pause");
    return 0;
}
搜索更多相关主题的帖子: 编写程序 include private public file 
2017-03-03 13:29
sunshine萝卜
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-1-1
收藏
得分:0 
回复 2楼 rjsp
可是我的是那种全篇都报错的那种,同学也说,看不出来问题
2017-03-03 13:50
sunshine萝卜
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2016-1-1
收藏
得分:0 
回复 4楼 rjsp
我知道错误在哪里了,谢谢解答!还有我也不是智商低到不行不行,用不着打这么个比方。
2017-03-03 17:10
快速回复:我运用DEV-C++ 编写程序,在#include<stdafx.h>这里报错
数据加载中...
 
   



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

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