Hi Gaurva

Reply embedded.

 

Thanks!! and have a nice day!!

Jaspreet

 

-----Original Message-----
From: Gaurav Wadhwa [mailto:[EMAIL PROTECTED]]
Sent
:
Thursday, December 23, 2004 6:19 PM
To: [EMAIL PROTECTED]
Subject: Re: (PT) How the memory gets allocated to the class?

 

Hi Ankush

I think memory for the functions is allocated for every object not only once

 

Jaspreet -> No Ankush, you are wrong. Memory is allocated for functions only once and it is variables for which memory is allocated for each instance. That is why same function can be used with different instances (which have different copies of data members)

 

as they are executed independently for each object and function's variables require sperate storage. Pls correct if something is wrong.

Regards

Guarav

Ankush Jain <[EMAIL PROTECTED]> wrote:

hello,

memory is allocated in stack memory and heap memory.

 

after an object of a class is created, variables are allocated in stack memory(as many times as the number of objects are created) whereas functions are allocated in heap memory (only once).

 

i know very litle about this, so i can be wrong too.

bye

ankush.

 

> Hi All,
>   I would like to know the answer of the following
> question?
>   Let assume that you have a class A and it has 2
> functions.  So while creating an object for the given
> class A, how the memory gets allocated to the object?
> Is the memory gets allocated from the reference of the
> object files?
>

Yahoo! India Matrimony: Find your life partner online.

To unsubscribe : [EMAIL PROTECTED]



Yahoo! India Matrimony: Find your life partner online.

To unsubscribe : [EMAIL PROTECTED]






Note:
This message is for the named person's use only.  It may contain confidential, proprietary or legally privileged information.  No confidentiality or privilege is waived or lost by any mistransmission.  If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender.  You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. MINDTECK (INDIA) LTD and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks.
Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity.
 
Thank You.



To unsubscribe : [EMAIL PROTECTED]




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to