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

Simplifying Radical expressions. The square root of 512m3. (Algebra 2)
Birds have been observed puffing up their feathers under certain conditions. By trapping air between feathers, this behavior helps the bird do what?
How will the size of the model for 100,000 compare to the size of the model for 10,000
Birds have been observed puffing up their feathers under certain conditions. By trapping air between feathers, this behavior helps the bird do what?
write in numbers 38 million 7 thousand 58
A 1.0 kg mass is attached to the end of a 1.00 m long string and swung in a horizontal circle.  If the mass completes one cycle in 0.42 s, the speed of the mass
How do u get 37 with using four 4s
Square root 6g=(j+y) for g. Solve the equation
Write two expressions where the solution is 41
Continue the pattern 7,16,8,27,9,?