In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to initialize C++ pointer". In daily operation, I believe many people have doubts about how to initialize C++ pointer. The editor consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to initialize C++ pointer"! Next, please follow the editor to study!
C++ pointer complete strategy
1. Understanding the concept of pointer
Int* p defines a pointer (it is recommended to use this way of writing int*, which is good for understanding)
P pointer variable
* indirect operator (accessor), which represents the space to which the address is accessed
* the corresponding (pointing) value in the address saved (pointed to) by the p pointer
& p gets the memory address of the pointer variable (the pointer itself takes up memory space)
So the pointer is
(1) access the memory space indirectly (directly through the variable name (memory space name))
(2) the pointer is a variable that holds the memory address of the variable, and it also takes up memory space.
Eg:
Two ways of pointer initialization
Int a = 40 ram / pointer initialization the first way to write int* p is a pointer variable, not a pointer variable used to store the memory address Note that the use of * p = & a here is a wrong definition and should assign a value to p (pointer variable), rather than * p (the value of the address saved by the pointer) / / the second way to initialize the pointer, which is essentially a simplified way of the first way of writing. Int* p1 = & a share cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.