Contents

Which of the following correctly reclaims an array of integers pointed by pointer p1?
a) delete p1;                         
b) delete *p1;
c) delete [] p1;     
d) delete [] *p1;

c

What is the value of pointer p after statement?  P = new char;
a) 0                                                        
b) x12
c) char                                   
d) cannot determine

d

What is the output of following statement?
int *p; p= new int;  *p=5;
a) 0                        
b) 5                        
c) -5       
d) none of these

b

A pointer to a structure may be used as
a) structure member           
b) function return type
c) function parameter        
d) all of these

d

What is the output of following statements?
char x=’a’;  char* p=&x; *p=’b’;
a) p now points to value a                
b) p holds the value b
c) p points the variable x                 
d) p holds the value x

c

What is the value of q after statement?
int a[10], *p, *q;
p= &a[3]; q=p; q+=2;
a) value a[3]                        
b) address of a[3]
c) value of a[5]   
d) address of a[5]

d