C-Pointers Question and Answer

C-Pointers Question and Answer
41. Given the declaration double prec [5]; the address of the element prec [2] is obtained by:
  • &prec [2]
  • prec +2
  • both options a and b
  • *(prec +2)
Show Answer
42. Given the declaration int prec[5]; the element prec[2] is accessed by
  • prec [2]
  • prec +2
  • *(prec + 2)
  • both options a and c
Show Answer
43. Given float x [5][5]; the address of the element x [2] [3] is obtained by
  • &x[2][3]
  • x[2] +3
  • *(prec +2)
  • all the above
Show Answer
44. Given char s[4][10]; the element s[2][4] is accessed by
  • s[2][4]
  • *(s[2] + 4)
  • *( *(s + 2) + 4)
  • all the above
Show Answer
45. Given int a[5][5]; identify the correct expression, yielding the starrting element.
  • *a[0]
  • **a
  • a[0][0]
  • all the above
Show Answer
46. Given int x[5] [10] [8]; find the address of the element x[2][3][5].
  • x[2][3] + 5
  • *(x[2] + 3) + 5
  • * ( *(x + 2)+ 3 +5
  • all the above
Show Answer
47. Given int x [5][5][5]; find the value of the element x[2][3][4]
  • *( x[2][3] + 4)
  • *( *(x[2] + 3) + 4)
  • *(*(*(x+2) + 3) + 4)
  • all the above
Show Answer
48. Given int a [5]; how to declare arrau in the function definition if the function call is sort (a).
  • sort (int *a
  • sort (int a[5])
  • both options a and b
  • sort (int a)
Show Answer
49. The declaration float *a[5]; is
  • an ordinary array
  • a pointer to an array
  • an array of pointers
  • pointer to an array
Show Answer
50. The declaration int (*p) [8]; is
  • an array of pointers
  • a pointer to an array
  • pointer to function
  • function returning pointer
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test