C++ PointerPointer is a variable in C++ that holds the address of another variable. They have data type just like variables, for example an integer type pointer can hold the address of an integer variable and an character type pointer can hold the address of char variable.
C++ pointer syntax
C++ Pointer example
Why C++ pointers are important?Pointers are very important, because it will allows us to access addresses and manipulate their contents. Pointers are the most complex and difficult feature in C/C++ language. If pointers are used in a correct way it will improve the efficiency and performance of the application.
Initializing null pointersWe can initialize a pointer to 0 or NULL, which is pointing to nothing. Null pointer points to empty location in memory.
Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: firstname.lastname@example.org.