Quiz on Pointers to Class in C++



1. What is the primary use of pointers in C++?
2. How do you declare a pointer to a class object in C++?
3. Which operator is used to access members of a class through a pointer?
4. What happens if you try to access a member variable using a null pointer?
5. What is the purpose of the 'new' operator in C++?

Advertisements