for example:
Let a = { -b, b,b}, where b<Max and 2b>Max.
then the first sum will be b, but the caculation of the second sum will end up with an overflow.
As for the second problem, I think the error lies in the illegal access to pNumber in Bolt::init(). That is because pNumber is a private member, so it is only accessable to the methods in the same class with it. In fact, even if there is no violation to access right here, say pNumber is a public number, this line also should be ruled out, since father's no-argument constructor will be called automatically in the beginning of the execution of son's constructor, if no explicit call to father's constructor is put on the first line in son's constructor.
Buddy, could you kindly share your job hunting experience with me? I am falling flatly on that, help!!!
Let a = { -b, b,b}, where b<Max and 2b>Max.
then the first sum will be b, but the caculation of the second sum will end up with an overflow.
As for the second problem, I think the error lies in the illegal access to pNumber in Bolt::init(). That is because pNumber is a private member, so it is only accessable to the methods in the same class with it. In fact, even if there is no violation to access right here, say pNumber is a public number, this line also should be ruled out, since father's no-argument constructor will be called automatically in the beginning of the execution of son's constructor, if no explicit call to father's constructor is put on the first line in son's constructor.
Buddy, could you kindly share your job hunting experience with me? I am falling flatly on that, help!!!