인스턴스 생성시 스택생성
글쓴이: pok / 작성시간: 화, 2005/11/22 - 10:56오후
삽질하다가 만든 쓸모없는 삽질코드입니다.
class Iterator { public: Iterator(){Pcb aPcb_;} void setIterator(Queue* _pQueue){aPcb_ = *(_pQueue->getHead());} bool valid(){return aPcb_.next != NULL;} void next(){if(aPcb_.next != NULL){aPcb_ = *(aPcb_.next);}} Pcb* getIt(){return &aPcb_;} private: Pcb aPcb_; };
컴파일은 문제없는데 메모리검사 해보면
Quote:
setIterator(Queue* _pQueue){aPcb_ = *(_pQueue->getHead());}
이부분에서 aPcb_에 스택이 없다고 나옵니다(..맞나?)
근데, 인스턴스를 생성할때 aPcb_스택이 생성되는게 아닌가요?
그게 아닌가 싶어서 생성자에도 다시 선언을 해주었는데 안되네요.
인스턴스 생성시에 스택이 어떤식으로 만들어지고 접근은 어떻게 해야 하나요?
Forums:
댓글 달기