| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 590 人关注过本帖
标题:[求助]新手求助,还望各位指点一下。谢谢。
取消只看楼主 加入收藏
anoldyan
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-9-11
收藏
 问题点数:0 回复次数:1 
[求助]新手求助,还望各位指点一下。谢谢。

这次我真的不清楚问题出在哪儿了。

//Listing 5.7 - demonstrates use
//of default parameter values
#include <iostream>

int AreaCube(int length,int width = 25,int height = 1);

int main()
{
int length = 100;
int width = 50;
int height = 2;
int area;

area = AreaCube(length,width,height);
std::cout << "First area equals:" << area << "\n";

area = AreaCube(length,width);
std::cout << "Second time area equals:" << area << "\n";

area = AreaCube(length);
std::cout << "Third time area equals:" << area << "\n";
char response;
std::cin >> response;
return 0;
}

AreaCube(int length,int width,int height)
{

return (length*width*height);
}


编译提示: ISO C++ forbids declaration of `AreaCube' with no type ,而且提示出错的地方是倒数第四行的{

搜索更多相关主题的帖子: default include equals values 
2007-11-02 23:23
anoldyan
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2007-9-11
收藏
得分:0 
谢谢各位的指点!看来书上的东西也不能完全照搬。
2007-11-05 09:18
快速回复:[求助]新手求助,还望各位指点一下。谢谢。
数据加载中...
 
   



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

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