0
은 C++로 하나 이상의 파라미터 생성자를 가질 수이며 매개 변수 소멸자C++ 하나 생성자 이상 생성
은 C++로 하나 이상의 파라미터 생성자를 가질 수이며 매개 변수 소멸자C++ 하나 생성자 이상 생성
가 C에서 하나 이상의 파라미터 생성자를 갖는 것이 가능하다를 갖는 것이 가능하다 ++?
예.
예컨대 :
class square
{
int m_top;
int m_left;
int m_right;
int m_bottom;
public:
// Constructor for case when all data is provided
square(int top, int left, int right, int bottom) : m_top(top), m_left(left), m_right(right), m_bottom(bottom)
{
}
// Constructor for case when some data is missing
square(int top, int left) : m_top(top), m_left(left), m_right(top+1), m_bottom(left+1)
{
}
// ... other members (like default constructor, getters, setters, etc.)
};
과 이용이 가능 매개 변수와 소멸자을 가지고? 하지 옵션에서
번호
당신은 destrtuctor in C++ reference에 대한 몇 가지 옵션을 찾을 수 있지만, 이름과 서명 (매개 변수).
(1) 예. (2) 아니오. – songyuanyao