انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Pointers and References

الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 2
أستاذ المادة احمد علي حسين الجنابي       28/10/2017 14:26:19
Pointers and References

Understanding how pointers and references work is one step toward being able to
write programs that are effective in their consumption of system resources.
In this lesson, you find out
What pointers are
What the free store is
How to use operators new and delete to allocate and free memory
How to write stable applications using pointers and dynamic allocation
What references are
Differences between pointers and references
When to use a pointer and when to use references


What Is a Pointer?
Put simply, a pointer is a variable that stores an address in memory. Just the same way
as a variable of type int is used to contain an integer value, a pointer variable is one
that is used to contain a memory address, as illustrated in the following Figure.

Thus, a pointer is a variable, and like all variables a pointer occupies space in memory
(in the case of Figure, at address 0x101). What’s special about pointers is that the
value contained in a pointer (in this case, 0x558) is interpreted as a memory address.
So, a pointer is a special variable that points to a location in memory.


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .