Pointers Questions and Answers

Practice Mode
Showing 10 of 217 questions
Q181
Find the output void main () const * ptr=(const*) "SHYMLI"; ptr+=2; printf("%s", ptr); }
  • A SHYMALI
  • B YAMLI
  • C MLI
  • D Error: can not modify constant object
Answer: Option C
Q182
Find the output void main ( ) char *p="Hi Bye"; printf("*%s*", p); }
  • A *ai By*
  • B *Hi Bye*
  • C *%s*
  • D Compiler error
Answer: Option B
Q183
Find the output void test (int, int*); void main () { int *iptr, j, k=2; iptr=&j; j=k; printf("%d %d", k,j); test (j, iptr); printf ("%d %d", k,j); } void test (int 1,  int *p) { 1++; (*p)++; }
  • A 2 3 3
  • B 2 3 4 3
  • C 2 2 2 3
  • D None of these
Answer: Option C
Q184
When a pointer points to zero or base address of a segment is called
  • A Null pointer
  • B Generic pointer
  • C Smart pointer
  • D Near pointer
Answer: Option A
Q185
Find the output void main ( ) { char *str1="D.A.V. \0 SHYAMLI"; char *str2[20]; strcpy (str2, str1); printf("%s", str2); }
  • A D.A.V. \0 SHYAMLI
  • B D.A.V.
  • C D.A.V. SHYMLI garbage
  • D D.A.V. Garbage
Answer: Option B
Q186
Which of the following is true about the following code : #include "alloc.h" void main () { printf ("The size of heap is =%u Bytes", coreleft( ) ); }
  • A Gives the maximum sizeof heap area.
  • B Returns the number of unused memory left on heap.
  • C Gives the minimum size of heap area
  • D Returns the maximum size -minimum size of heap)area
Answer: Option B
Q187
Find the output void main ( ) { int x=440; int **q; const **p=* (&x); q=*(&p)+60; printf("%d", q); }
  • A 500
  • B 560
  • C 440
  • D Compilation error
Answer: Option B
Q188
Which of the following is true ?
  • A Near pointer is a normalize pointer
  • B Far pointer is a normalize
  • C Huge pointer is a normalize pointer
  • D None of these
Answer: Option C
Q189
Without the knowledge of pointer if memory is de-allocated it will be
  • A smart pointer
  • B Dangling pointer
  • C Null pointer
  • D Generi pointer
Answer: Option B
Q190
Attempts to write data in a read only location is called
  • A Segmentation fault
  • B Generic pointer
  • C Null pointer assignment
  • D None of these
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test