형식지정자가 필요합니다 라고 뜹니다..

조회수 6250회

pragma once

include"AccountArray.h"

class AccountHandler

{

public:

AccountHandler()

{

}
void ShowMenu() const;
void CreatAccount();
void Deposit();
void Withdraw();
void ShowAccount() const;
~AccountHandler();

private:

AccountArray  account(10); //?????이부분에서 에러가뜹니다  10자리에 밑줄뜨면서 형식지정자가 필요하다고 뜹니다

int accNum=0;

};

이게 인클루드한 내용입니다

pragma once

include"Account.h"

typedef Account* ACCOUNT_PTR;

class AccountArray {

public:

AccountArray(int idx);
ACCOUNT_PTR& operator[](int idx);
ACCOUNT_PTR& operator[](int idx) const;
~AccountArray();

private:

ACCOUNT_PTR* account;
int arrlen;

AccountArray(const AccountArray& ref)
{}
AccountArray& operator=(const AccountArray& ref)
{}

};

include

include"AccountArray.h"

AccountArray::AccountArray(int len)

:arrlen(len)

{

account = new ACCOUNT_PTR[len];

}

ACCOUNT_PTR& AccountArray::operator

{

if (idx < 0 || idx >= arrlen)

{
    std::cout << "out of range" << std::endl;
    exit(1);
}
return account[idx];

}

ACCOUNT_PTR& AccountArray::operatorconst

{

if (idx < 0 || idx >= arrlen)
{
    std::cout << "out of range" << std::endl;
    exit(1);
}
return account[idx];

}

AccountArray::~AccountArray()

{

delete[] account;

}

헤더파일꼬임문제라고도하길래 여러방면으로 수정해봤는대 저부분만 해결이안되길래 질문해봅니다..

  • (•́ ✖ •̀)
    알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)