Q: The void pointer can point to which type of objects?
Solution: Because it doesn’t know the type of object it is pointing to, So it can point to all objects.
Q: When does the void pointer can be dereferenced?
Solution: By casting the pointer to another data type, it can be dereferenced from the void pointer.
Q: The pointer can point to any variable that is not declared with which of these?
Solution: Pointer can point to any variable that is not declared with const & volatile.
Q: A void pointer cannot point to which of these?
Solution: A void pointer can point to methods & class member in c++.
Q: What we can’t do on a void pointer?
Solution: Because the void pointer is used to cast the variables only, So pointer arithmetic can’t be done in a void pointer.
Q: The data elements in the structure are also known as what?
Solution: Variables declared inside a class are called as data elements or data members.
Q: What will happen when the structure is declared?
Solution: While the structure is declared, it will not be initialized, So it will not allocate any memory.
Q: The declaration of the structure is also called as?
Solution: The structure declaration with open and close braces and with a semicolon is also called structure specifier.
Q: Which of the following is a properly defined structure?
Solution: option struct {int a;} is not correct because name of structure and ;(after declaration) are missing. In option struct a_struct {int a;} ; is missing. In option struct a_struct int a; {} are missing.
Q: Which of the following accesses a variable in structure *b?
Solution: Because arrow operator(->) is used to access members of structure pointer whereas dot operator(.) is used to access normal structure variables.
You Have Score    | /10 |