게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
[본삭금] c++ c2664 에러가 나는데 해결방법을 도저히 모르겠습니다
게시물ID : programmer_22311짧은주소 복사하기
작성자 : 안녕하세
추천 : 0
조회수 : 9951회
댓글수 : 5개
등록시간 : 2018/04/17 23:59:42
옵션
  • 본인삭제금지
//c2664
#include <iostream>
#include <cstring>
using namespace std;

class PermanentWorker
{
private:
char name[100];
int salary;
public:
PermanentWorker(char *name, int money)
:salary(money)
{
strcpy(this->name, name);
}
int GetPay() const
{
return salary;
}
void ShowSalaryInfo() const
{
cout << "name: " << name << endl;
cout << "salary: " << GetPay() << endl << endl;
}
};

class EmployeeHandler
{
private:
PermanentWorker * empList[50];
int empNum;
public:
EmployeeHandler():empNum(0)
{}
void AddEmployee(PermanentWorker *emp)
{
empList[empNum++] = emp;
}
void ShowAllSalaryInfo() const
{
for (int i = 0; i < empNum; i++)
empList[i]->ShowSalaryInfo();
}
void ShowTotalSalary() const
{
int sum = 0;
for (int i = 0; i < empNum; i++)
sum += empList[i]->GetPay();
cout << "salary sum: " << sum << endl;
}
~EmployeeHandler()
{
for (int i = 0; i < empNum; i++)
delete empList[i];
}
};

int main(void)
{
EmployeeHandler handler;

handler.AddEmployee(new PermanentWorker("KIM", 1000));   // c2664
handler.AddEmployee(new PermanentWorker("LEE", 1500));   // c2664
handler.AddEmployee(new PermanentWorker("JUN", 2000));   // c2664

handler.ShowAllSalaryInfo();

handler.ShowTotalSalary();
return 0;

}


공부를 하다가 예제를 입력해봣는데 메인함수에서 객체선언을 했을 때 c2664에러가 발생해서
구글링을 해보니 속성에서 유니코드문자를 멀티바이드문자로 바꾸라고 하는데 바꿔도 에러가 발생하고
_T(" ")나 TEXT(" ")를 써봐도 에러가 발생합니다...... 몇일째 찾고 있는데 답이 안나오네요 도와주세요 !!
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호