C++ Overriding… overwriting?

后端 未结 5 1559
情深已故
情深已故 2020-12-14 19:51

I know what overriding is in C++. But, is there overwriting? If so, what does it mean?

Thanks.

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 20:37

    In C++ terminology, you have overriding (relating to virtual methods in a class hierarchy) and overloading (related to a function having the same name but taking different parameters). You also have hiding of names (via explicit declaration of the same name in a nested declarative region or scope).

    The C++ standard does not use the term "overwrite" except in its canonical English form (that is, to replace one value with a new value, as in the assignment x = 10 which overwrites the previous value of x).

提交回复
热议问题