Pregunta de entrevista de Siemens

can you explain malloc and new differences? waht do you now reference and pointer ? What is the differences ?

Respuesta de la entrevista

Anónimo

12 may 2025

mallac and new are memeory allocated in heap memory. malloc is a function in stdlib library and retur value pointer also initial value garbage value. reference is second name for a variable , we have to assign relevant variable to define it. Not change for a variable. Pointer is a variable to point other variable address.