小编Rus*_*ton的帖子

我的代码出了什么问题?我的程序不会编译

好的,所以我的任务是建立在本书的现有代码上.我必须添加第3个框,然后计算所有3个框的总数.这是我到目前为止所写的内容,但它不会编译.请帮我找到问题所在.谢谢.

我正在使用的程序是MS Visual C++,我得到的complile错误是

错误C2447:'{':缺少函数头(旧式正式列表?)

引用{after my int Total_Volume行

// Structures_and_classes.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using std::cout;
using std::endl;
class CBox // Class definition at global scope
{
public:
 double m_Length; // Length of a box in inches
 double m_Width; // Width of a box in inches
 double m_Height; // Height of a box in inches
};
int main();
int Total_Volume;
{
CBox box1;
CBox box2;
CBox box3;
 double boxVolume …
Run Code Online (Sandbox Code Playgroud)

c++

1
推荐指数
1
解决办法
608
查看次数

标签 统计

c++ ×1