Malloc question | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
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 Antworten
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