令人困惑的错误消息 [英] Confusing Error Message
问题描述
在编写程序的简化版本时,我在下面的课程中创建了
,但是当我去编译并运行程序
时出现错误说
一种声明中的多种类型并且提到了一个
" [Build Error]"和错误1
它还突出显示最后一行(带有右括号的那一行和
分号),我看不出是什么错了,请帮助
威尔逊
班级检查:公共帐户
{
朋友无效new_account();
公开:
int abc;
};
Wilson< tp **** @ googlemail.comwrote:
写一个简化版一个程序的版本我创建了
下课,但是当我去编译并运行程序
时出现错误说
一种声明中的多种类型并且提到了一个
" [Build Error]"和错误1
它还突出显示最后一行(带有右括号的那一行和
分号),我看不出是什么错了,请帮助
威尔逊
班级检查:公共帐户
{
friend void new_account();
public:
int abc;
};
您没有提供足够的信息来诊断您的问题。请参阅
http ://www.parashift.com/c++-faq-lit...t.html#faq-5.8
有关如何发布不起作用的代码的指南。
-
Marcus Kwok
用''net''替换''invalid''回复
3月23日下午5:48,ricec ... @ gehennom.invalid(Marcus Kwok)写道:
Wilson< tpw ... @ googlemail.comwrote:
在编写程序的简化版本时我创建了
以下类,但是当我去编译并运行程序
时出现错误,说
"多种类型一个声明并且提到了一个
" [Build Error]"和错误1
它还突出显示最后一行(带有右括号的那一行和
分号),我看不到有什么问题,请帮助
wilson
class检查:公共账户
{
朋友无效new_account();
公开:
int abc;
};
您没有提供足够的信息来诊断您的问题。 Seehttp://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
有关如何发布无效代码的指南。
-
Marcus Kwok
将''invalid''替换为''net''以回复 - 隐藏引用的文字 -
- 显示引用文字 -
抱歉。操作系统是使用Dev c ++的windows,下面是
整个代码,main()只包含一个
类的简单函数调用,这不会导致任何问题。完整的错误消息表示[构建
错误]多个类型在一次删除中错误1
#include< iostream>
#include< time.h>
#include< fstream>
使用命名空间std;
班级帐号
{
public:
virtual void returnbalance(){cout<<平衡; }
虚拟空置存款(浮动金额)
{
余额+ =金额;
std :: cout << "
" <<金额<< "已被添加到
您的帐户 << std :: endl;
}
虚拟撤回(浮动金额)
{
if(余额) )
{
余额 - =金额;
std :: cout<< "
Hi, while writing a simplified version of a program i created the
following class, however when i went to compile and run the program
there was an error saying
"multiple types in one declaration" and there was a mention of a
"[Build Error]" and "Error 1"
it also highlights the final line (the one with a closing brace and
semi-colon), i cannot see what is wrong with this, please help
wilson
class checking : public Account
{
friend void new_account();
public:
int abc;
};
Wilson <tp****@googlemail.comwrote:Hi, while writing a simplified version of a program i created the
following class, however when i went to compile and run the program
there was an error saying
"multiple types in one declaration" and there was a mention of a
"[Build Error]" and "Error 1"
it also highlights the final line (the one with a closing brace and
semi-colon), i cannot see what is wrong with this, please help
wilson
class checking : public Account
{
friend void new_account();
public:
int abc;
};You have not provided enough information to diagnose your problem. See
http://www.parashift.com/c++-faq-lit...t.html#faq-5.8
for guidelines on how to post code that doesn''t work.
--
Marcus Kwok
Replace ''invalid'' with ''net'' to reply
On Mar 23, 5:48 pm, ricec...@gehennom.invalid (Marcus Kwok) wrote:Wilson <tpw...@googlemail.comwrote:Hi, while writing a simplified version of a program i created the
following class, however when i went to compile and run the program
there was an error saying
"multiple types in one declaration" and there was a mention of a
"[Build Error]" and "Error 1"
it also highlights the final line (the one with a closing brace and
semi-colon), i cannot see what is wrong with this, please help
wilson
class checking : public Account
{
friend void new_account();
public:
int abc;
};
You have not provided enough information to diagnose your problem. Seehttp://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8
for guidelines on how to post code that doesn''t work.
--
Marcus Kwok
Replace ''invalid'' with ''net'' to reply- Hide quoted text -
- Show quoted text -sorry. the operating system is windows using Dev c++ and below is the
whole code, main() only includes a simple function call for one of the
classes which causes no problems. the full error message says "[Build
error] multiple types in one decleration "error 1" "
#include <iostream>
#include <time.h>
#include <fstream>
using namespace std;
class Account
{
public:
virtual void returnbalance(){ cout << balance; }
virtual void deposit(float amount)
{
balance += amount;
std::cout << "
" << amount << " Has Been Added To
Your Account" << std::endl;
}
virtual void withdraw(float amount)
{
if (balance amount)
{
balance -= amount;
std::cout << "
这篇关于令人困惑的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!