Domanda di colloquio di Siemens

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

Risposta di colloquio

Anonimo

12 mag 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.