Hi,
I'm new in C++ programimng :(
& I have a couple of questions to ask about :-
1- I have to build 5 clases & in each one I have to overide the opretaros new & delete ...so in each time I call the "new operator" it should print in a file how many bytes my object size is & the total size that I have righty now from this object in my program ... So I think that I have to have 5 fields of int for ech class so I could save the total bytes that in my program right now from this object & could increase to this variable & decrease acoordinglly whether I call new/delete opretaor,,,
My question is,,in which type should these fields be,,static int/static const int ?!?!
should ech field be inside it's class ? or should I make these fields global !! which mean to build an incapsulation class to all my fife clases ,,So these classes are a member in the new one & additional to them I have my 5 fields so in ech time I update the appropriate field ???
2- I have been asked to write a global functions,,how can I do it ??
thanks a lot
have a nice day
I'm new in C++ programimng :(
& I have a couple of questions to ask about :-
1- I have to build 5 clases & in each one I have to overide the opretaros new & delete ...so in each time I call the "new operator" it should print in a file how many bytes my object size is & the total size that I have righty now from this object in my program ... So I think that I have to have 5 fields of int for ech class so I could save the total bytes that in my program right now from this object & could increase to this variable & decrease acoordinglly whether I call new/delete opretaor,,,
My question is,,in which type should these fields be,,static int/static const int ?!?!
should ech field be inside it's class ? or should I make these fields global !! which mean to build an incapsulation class to all my fife clases ,,So these classes are a member in the new one & additional to them I have my 5 fields so in ech time I update the appropriate field ???
2- I have been asked to write a global functions,,how can I do it ??
thanks a lot
have a nice day
Comment