Creado por Adriana Vincelli-Joma
hace alrededor de 3 años
|
||
Pregunta | Respuesta |
function name decoration | - technique used to solve various problems caused by need to resolve unique names for programming entities - process used by C++ compilers give each function in your program unique name |
overloading | - single word has multiple meanings - allows specification of more than one function of the same name in the same scope |
type-safe linkage | - enforces right number and type of parameters passed at link time - safety net if you mis-declare a function |
union | - similar to structure - defines single location that can be given many different member names |
union vs class/structure | 1. union cannot be used as base class during inheritance; class can be used as base 2. structure allocates different memory location for all members; union allocates common memory location for all members |
default argument | value given in declaration that compiler automatically inserts if you don't provide value in function call |
placeholder arguments | - direct position of value in function - allows you to change function definition to use placeholder later, without changing all code where function is called |
overloading over default arguments | 1. default arguments shouldn't be used as flag upon which to conditionally execute code 2. function should be broken into two or more overloaded functions |
default arguments over overloading | 1. default arguments make it easier to write function calls and easier to read them 2. by defaulting all new arguments, you ensure that all client code using previous interface is not disturbed |
¿Quieres crear tus propias Fichas gratiscon GoConqr? Más información.