Skip to content

Latest commit

 

History

History
1 lines (1 loc) · 429 Bytes

7.36.md

File metadata and controls

1 lines (1 loc) · 429 Bytes

The order of member initialization is the same with the order they appear in the class definition. Since rem appears first, it will be initialized first. But the value of base is undefined when rem is initialized, thus the value of rem is undefined. To fix the problem, we can either switch the order of definitions of rem and base or we can use the constructor parameters i and j direct initialize rem(i % j).