Champion4001 Champion4001
  • 11-11-2020
  • Computers and Technology
contestada

Sptr is a pointer pointing to the beginning of an array called sarray. To access the value in sarray[3] by using the pointer, you would use:a) *sptr[*3] b) *sptr+3 c) sptr +3 d) *(sptr + 3)

Respuesta :

doulatrajput786 doulatrajput786
  • 12-11-2020

Answer:

The correct option for accessing the value in sarray[3] is : d) *(sptr+3)

Explanation:

a) *sptr[*3]  is wrong option because its syntax is not right it will give errors.

b) *sptr+3 is also wrong option because it will add 3 to the value of sarray[0].

c) sptr+3 is wrong option because it will only access the address of sarray[3] not the value it contains.

d) *(sptr +3) is correct syntax for accessing value in sarray[3] by using pointer

Answer Link

Otras preguntas

In the top row of an chessboard, Tom writes the values 1, 2, 4, 8, 16, 32, 64, 128. In the leftmost column, Tom writes the values 1, 3, 9, 27, 81, 243, 729, 2
What's the answer to this problem?
How do you find the interior angles of a triangle, if only one is given angle is given to you?
Examples of cultural diffusion in ancient Rome pertaining to government
what is the negative of -1/3 and why??
pythagorean theorem If l = 12 cm and m = 35 cm, what is the length of n?
Alison wants to find out how much time people spend reading books. She is going to use a questionnaire. Design a suitable question for Alison to use in her ques
A hiking club has 9 members. How many ways can they choose a president, vice president, secretary, and treasurer from among the members?
what is greater 0.7 or 7/9?
in what situation does friction make an object change its shape