wu :: forums
« wu :: forums - :o Google Question »

Welcome, Guest. Please Login or Register.
Mar 20th, 2025, 2:38am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: SMQ, ThudnBlunder, towr, Grimbal, Eigenray, william wu, Icarus)
   :o Google Question
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: :o Google Question  (Read 1080 times)
saiyadshakil
Newbie
*





   


Posts: 4
:o Google Question  
« on: Oct 4th, 2007, 1:14am »
Quote Quote Modify Modify


How would you implement malloc in C and garbage collection in C++?
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re:  :o Google Question  
« Reply #1 on: Oct 4th, 2007, 1:22am »
Quote Quote Modify Modify

Isn't malloc already implemented in C, why would it need to be reimplemented? Or are we writing a new compiler in C?
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
saiyadshakil
Newbie
*





   


Posts: 4
Re:  :o Google Question  
« Reply #2 on: Oct 4th, 2007, 9:38am »
Quote Quote Modify Modify

yeah it is already implemented in C but they want to see how you can implement your own MALLOC function....I mean to say .."allocate memory dynamically w/t using malloc in C"...so he gave the hint to write definition of malloc in C...
IP Logged
GowriKumar
Junior Member
**





   
WWW Email

Gender: male
Posts: 55
Re:  :o Google Question  
« Reply #3 on: Oct 24th, 2007, 11:10am »
Quote Quote Modify Modify

The C Bible, K & R C has an impelemntation for malloc Smiley
 
Hint : use brk() system call.
IP Logged

www.gowrikumar.com
saiyadshakil
Newbie
*





   


Posts: 4
Re:  :o Google Question  
« Reply #4 on: Oct 24th, 2007, 12:53pm »
Quote Quote Modify Modify

ohhh thanks...
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board