나는 코드는 매우 비슷한 있습니다포인터를 추가 할 수없는 이유는 무엇입니까?
LINT_rep::Iterator::difference_type LINT_rep::Iterator::operator+(const Iterator& right)const
{
return (this + &right);//IN THIS PLACE I'M GETTING AN ERROR
}
LINT_rep::Iterator::difference_type LINT_rep::Iterator::operator-(const Iterator& right)const
{//substracts one iterator from another
return (this - &right);//HERE EVERYTHING IS FINE
}
err msg: Error 1 error C2110: '+' : cannot add two pointers
왜 난 단지 한 곳에서가 아니라 모두에서 오류를 받고 있어요?
포인터 추가 란 무엇을 의미합니까? 집 주소가 3472 Main 인 경우 2와 같은 숫자를 추가하면 3474 Main이 이웃이 될 가능성이 큽니다. 하지만 두 주소를 추가하면 6946이됩니다. 그게 무슨 뜻입니까? –