Puedes seguirnos en

BUSCADOR

Engineering

The concept of object as a function argument

An object can be used as a function argument. This can be done in two ways.

i) Pass by value: A copy of an entire object is passed to the function, so any changes made to the object inside the function do not affect the object  used to call the function.

ii) Pass by reference: Only the address of the object is transferred to the function. When an address of the object is passed, the called function works directly on the actual object used in the call. This means that any changes made to the object inside the function will reflect the actual object.

The pass by reference method is more efficient since it requires to pass only address of the object and not the entire object.

Anuncio publicitario

Escrito por

Administrador de ENGGDRCAOS. Canal dedicado especialmente a la formación del estudiante que aspira a ser ingeniero. Todos los videos son Ingles. Apasionado del universo Apple, estudiante de Ingeniería y Gamer por vocación.

Publicidad

ARTÍCULOS RELACIONADOS