No student devices needed. Know more
10 questions
In a C++ Program if
int a = 5;
Int *ptr = &a;
then the cout statement with
&a, a, ptr
adrress, Value, Adress
address, value, value
all address
All values
In a C++ program,
int a = 20;
ptr = &a;
cout<<ptr<<endl;
output is:
address of a
address of ptr
value of a
value and address
What does this command do?.
Creates a pointer of type integer that is initially pointing to null.
Creates a pointer of type integer that is initially pointing to 0.
Creates a pointer in the heap
None of the answers are valid
The process of assigning address of a variable to a pointer variable is known as___________
Initialization
Declaration
int *p; tell the compiler
*tells that the variable p is a pointer variable
p needs a memory location
p points to a variable of type int.
to find the value of p
A pointer which is not initialized is called as ________pointer
Wild
Null
void
new
The pointer whose value is zero is called as ______pointer
null
zero
void
new
Void [pointer can pointed at objects of any data type.
True
False
Declaration of pointer can be done by
datatype *p;
datatype* p;
datatype p;
datatype* p;
Address of a pointer is same as Address of variable.
True
False
Explore all questions with a free account