Abstract
Objects reside in memory. And so far, we have learned how to access and manipulate objects through variables. Another way to access an object in memory is through pointers. Each object in memory occupies a certain amount of bytes and has a type and an address. This allows us to access the object through a pointer. So, pointers are types that can hold the address of a particular object. For illustrative purposes only, we will declare an unutilized pointer that can point to an int object:
int main() { Â Â Â Â int* p; }
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature
About this chapter
Cite this chapter
Dmitrović, S. (2023). Pointers. In: Modern C++ for Absolute Beginners. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-9274-7_11
Download citation
DOI: https://doi.org/10.1007/978-1-4842-9274-7_11
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-9273-0
Online ISBN: 978-1-4842-9274-7
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)