C를 리턴하는 과정 도움 부탁드립니다.(초보올림)
글쓴이: chaosman / 작성시간: 토, 2013/10/05 - 10:17오전
이게 c를 리턴하는 과정에서 에러가 나는데 왜 에러가 나는지랑 어떻게 수정해야될지 감을 못잡겠어요 ㅜㅜㅜ
#include
using namespace std;
class c
{
public:
c(int n) : n(n)
{
p = new int[n];
};
c(const c &o) : n(o.n)
{
p = new int[n];
for(int i=0; i
}
~c(void)
{
if (p!=NULL) delete[] p;
};
private:
int n,*p;
};
c f(void)
{
c c(5);
return c;
}
void main(void)
{
c c(5);
c = f();
}
Forums:
댓글 달기