Podcast
Questions and Answers
Which of the following statements about pointers is correct?
Which of the following statements about pointers is correct?
- A pointer is a variable that holds the memory address of another variable of a different type.
- A pointer is a variable that holds the value of another variable of a different type.
- A pointer is a variable that holds the value of another variable of the same type.
- A pointer is a variable that holds the memory address of another variable of the same type. (correct)
What is the general syntax for declaring a pointer variable?
What is the general syntax for declaring a pointer variable?
- Datatype pointer_name;
- Datatype *pointer_name; (correct)
- pointer_name *Datatype;
- pointer_name Datatype;
Why is it important to initialize a pointer before use?
Why is it important to initialize a pointer before use?
- To ensure the pointer variable is of the correct data type.
- To allocate memory for the pointer variable.
- To prevent the pointer from pointing to a random memory location. (correct)
- To assign a value to the pointer variable.
How can a pointer be initialized?
How can a pointer be initialized?
What does the address of operator do?
What does the address of operator do?