Malloc question | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Malloc question

If I do malloc(10 * sizeof(int)); does it mean that I am allocating 10 ints (taking consideration that int has 4 bytes) ?

20th Jul 2020, 3:14 PM
João Vitor
João Vitor - avatar
2 Respuestas
20th Jul 2020, 3:22 PM
BroFar
BroFar - avatar
+ 1
Please read the below page to clear your doubt 👇 http://www.cplusplus.com/reference/cstdlib/malloc/
20th Jul 2020, 3:20 PM
Ipang