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

Evaluate the following vertices for the function f(x)=x+2y
Important areas to research before attending a college fair include: A. schools' athletic conferences. B. college founding dates. C. school mascots. D. admissio
For f (x) = 3x+1 and g(x) = x2 - 6, find (f.g)(x).
Social responsibility meaning?
Type the correct answer in the box. Use numerals instead of words. If necessary, use / for the fraction bar.
Write the 8-bit signed-magnitude, two's complement, and ones' complement representations for each decimal number: +25, + 120, + 82, -42, -111.
Define fitness as it relates to adaptation
How do villi help the lymphatic system?
For f (x) = 3x+1 and g(x) = x2 - 6, find (f.g)(x).
Find the volume, lateral surface area and total surface area of a regular octagonal pyramid of base 6.2cm and perpendicular height of 14.8cm.