[問題] 簡單錯誤卻找不到@@|
=====================已解決,感謝===================
以下C++
大家好,我有一個簡單的問題卻一直抓不到BUG在哪,勞煩各位幫忙,
這是描述.H的函式
#include<iostream>
#include<string>
#include "Account.h"
Account::Account(string name)
{ //一直抓不到這行的BUG
setAccount(name);
}
void Account::setAccount(string name)
{
nameofAccount =name;
}
string Account::getAccount()
{
return nameofAccount;
}
-----------------------------------------------
以下.H
#include <iostream>
#include <string>
using namespace std;
class Account
{
public:
Account(string);
string getAccount();
void setAccount(string);
void setMoney(int,int);
int getMoney();
private:
int getm;
int initial;
int money;
string nameofAccount;
}
他一直出現
new types may not be defined in a return type
return type specification for constructor invalid
在我有標記bug那行
麻煩各位高手了 感謝
※ 編輯: a77d4e06 來自: 218.35.19.53 (05/12 00:58)
→
05/12 00:59, , 1F
05/12 00:59, 1F
※ 編輯: a77d4e06 來自: 218.35.19.53 (05/12 01:00)
→
05/12 01:00, , 2F
05/12 01:00, 2F
→
05/12 01:01, , 3F
05/12 01:01, 3F
推
05/12 01:01, , 4F
05/12 01:01, 4F
→
05/12 01:01, , 5F
05/12 01:01, 5F
→
05/12 01:02, , 6F
05/12 01:02, 6F
※ 編輯: a77d4e06 來自: 218.35.19.53 (05/12 01:03)
→
05/12 01:07, , 7F
05/12 01:07, 7F
推
05/12 01:32, , 8F
05/12 01:32, 8F
→
05/12 12:55, , 9F
05/12 12:55, 9F