--:--









Quiz for Pointers basics and pointer arithmetic

Course: C++ Language | Subject: Unit 8 | Topic: Pointers and Dynamic Memory Management



Logo

Q1: What does a pointer in C++ store?

Logo

Q2: What is the output of the expression *ptr if ptr is a pointer?

Logo

Q3: Which operator is used to get the address of a variable?

Logo

Q4: What does pointer arithmetic mean?

Logo

Q5: If ptr is an int* pointing to an array, what does ptr + 1 point to?

Logo

Q6: What is a null pointer?

Logo

Q7: How do you declare a pointer to an integer?

Logo

Q8: What happens when you increment a pointer?

Logo

Q9: Which operator is used to access members of a structure via pointer?

Logo

Q10: What does the expression ptr-- do?

Logo

Q11: Can pointers be compared?

Logo

Q12: What is pointer decay?

Logo

Q13: What is the size of a pointer on a 64-bit system?

Logo

Q14: What does void* represent?

Logo

Q15: Is pointer arithmetic allowed on void* pointers?

Logo

Q16: How do you dynamically allocate memory for an int in C++?

Logo

Q17: How do you free dynamically allocated memory in C++?

Logo

Q18: What is the difference between delete and delete[]?

Logo

Q19: What is a dangling pointer?

Logo

Q20: What is a wild pointer?

Are you ready to start test? Set your time limit