- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How many levels of pointers can we have in C/C++?
Actually, C programs one or two static levels of pointers are common. Triple indirection is rare. But infinite is very common. Infinite pointer indirection can be achieved with the help of a struct.
struct list { struct list *next; ... } lst; lst->next->next->next->...->next
and in this way we can implement multiple pointer indirection.
There is another alternative notation as shown below
– *(*(..(*(*(*lst).next).next).next...).next).next
Advertisements
To Continue Learning Please Login
Login with Google