Home > Back-end >  For bosses to look at!
For bosses to look at!

Time:10-07

大佬们 我这里n=1 s是一个指向派生类对象的基类指针 里面的成员变量city的值是1 getcity()就是返回city的值 但是为啥会输出这些奇怪的数啊 实在不明白

CodePudding user response:

The city is what type? How derived base class definition? The post code

CodePudding user response:


The city is an integer

CodePudding user response:


These are derived class (weapon and as soldier)

CodePudding user response:

The place you sn assignment is posted, the same object 2 times to invoke the same method return value is different, must be where the memory information is modified somewhere

CodePudding user response:


This is the headquarter of constructors and copy constructor

CodePudding user response:


This is prinborn function with sn for assignment

CodePudding user response:


This is the other functions in a headquarter
  • Related