Complete the code to declare a pointer to an integer named ptr.
int [1] ptr;The asterisk (*) is used to declare a pointer variable in C++.
Complete the code to declare a pointer to a double named ptrDouble.
double [1] ptrDouble;The asterisk (*) is used to declare a pointer variable, here for a double type.
Fix the error in the pointer declaration for an integer pointer named p.
int [1] p;The correct symbol to declare a pointer is the asterisk (*). Using & or other symbols causes errors.
Fill both blanks to declare a pointer to a character named ptrChar and initialize it to nullptr.
char [1] ptrChar = [2];
The asterisk (*) declares the pointer, and nullptr initializes it to point to nothing safely.
Fill all three blanks to declare a pointer to a float named ptrFloat, initialize it to nullptr, and then assign it the address of variable val.
float [1] ptrFloat = [2]; float val = 3.14f; ptrFloat = [3] val;
The asterisk (*) declares the pointer, nullptr initializes it safely, and & gets the address of val to assign to the pointer.