What is the return type of malloc function as it allocate space it should return ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the return type of malloc function as it allocate space it should return ?

29th Jun 2016, 1:32 PM
Ash Singhal
Ash Singhal - avatar
4 Answers
+ 2
there is no malloc in Java. it has "new" keyword, which is used to allocate memory to objects and assign reference to the object variable. read more on that here http://stackoverflow.com/questions/4404872/is-there-something-like-malloc-free-in-java
29th Jun 2016, 7:30 PM
Neeraj
Neeraj - avatar
+ 1
malloc returns a pointer to the region in memory where storage was allocated
1st Jul 2016, 6:05 PM
Midhun Mathew
0
Neeraj have reason! that's it!
30th Jun 2016, 3:29 AM
Servando Reyes
Servando Reyes - avatar
0
Lol @Reyes
30th Jun 2016, 6:47 PM
Siddharth Garg
Siddharth Garg - avatar