Home >Backend Development >C++ >How many levels of pointers can we have in C/C++?
In fact, one or two static level pointers are common in C programs. Third-degree indirection is rare. But infinite pointer indirection is very common. Infinite pointer indirection can be achieved with the help of structures.
struct list { struct list *next; ... } lst; lst->next->next->next->...->next
In this way, we can achieve multiple pointer indirect references.
The following is another alternative representation
– *(*(..(*(*(*lst).next).next).next...).next).next
The above is the detailed content of How many levels of pointers can we have in C/C++?. For more information, please follow other related articles on the PHP Chinese website!