صفحه محصول - بررسی حافظه و منابع مدیریت


دانلود ورد با موضوع بررسی حافظه و منابع مدیریت دارای 33 صفحه و با فرمت .doc و قابل ویرایش و آماده برای ارائه ، چاپ ، تحقیق و کنفرانس می باشد.

 

تعداد صفحه : 33 صفحه
فرمت فایل: ورد .doc و قابل ویرایش
آماده برای : ارائه ، چاپ ، تحقیق و کنفرانس

 

قسمتی از متن نمونه:


C++ offers tremendous flexibility in managing memory, but few C++ programmers fully understand the available mechanisms. In this area of the language ,overloading , name hiding, constructors and destructors, exceptions, static and virtual functions, operator and non-operator functions all come together to provide great flexibility and customizability of memory management. Unfortunately, and perhaps unavoidably, things can also get a bit complex.
In this chapter, we’ll look at how the various features of C++ are used together in memory management, how they sometimes interact in surprising ways, and how to simplify their interactions.
Inasmuch as memory is just one of many resources a program manages, we’ll also look at how to bind other resources to memory so we can use C++’s sophisticated memory management facilities to manage other resources as well.


Failure to Distinguish Scalar and Array Allocation

Is a Widget the same thing as an array of Widgets? Of course not. Then why are so many C++ programmers surprised to find that different operators are used to allocate and free arrays and scalars?
We know how to allocate and free a single Widget. We use the new and delete operators:

Widget *w = new Widget( arg );
// . . .
delete w;

Unlike most operators in C++, the behavior of the new operator can’t be modified by overloading. The new operator always calls a function named operator new to obtain some storage, then may initialize that storage. In the case of Widget, above, use of the new operator will cause a call to an operator new function that takes a single argument of type size_t, then will invoke a Widget constructor on the uninitialized storage returned by operator new to produce a Widget object.
The delete operator invokes a destructor on the Widget and then calls a function named operator delete to deallocate the storage formerly occupied by the now deceased Widget object.

Variation in behavior of memory allocation and deallocation is obtained by overloading, replacing, or hiding the functions operator new and operator delete, not by modifying the behavior of the new and delete operators.

We also know how to allocate and free arrays of Widgets. But we don’t use the new and delete operators:

دانلود ورد با موضوع بررسی حافظه و منابع مدیریت دارای 33 صفحه و با فرمت .doc و قابل ویرایش و آماده برای ارائه ، چاپ ، تحقیق و کنفرانس می باشد

تعداد صفحه : 33 صفحه

فرمت فایل: ورد .doc و قابل ویرایش

آماده برای : ارائه ، چاپ ، تحقیق و کنفرانس

فایل های دیگر این دسته

مجوزها،گواهینامه ها و بانکهای همکار

سارا دارای نماد اعتماد الکترونیک از وزارت صنعت و همچنین دارای قرارداد پرداختهای اینترنتی با شرکتهای بزرگ به پرداخت ملت و زرین پال و آقای پرداخت میباشد که در زیـر میـتوانید مجـوزها را مشاهده کنید