Which of the following statements about pointer arithmetic is true?

A. Any arithmetic operator can be used to change the value of a pointer.
B. Given a pointer ptr, ptr + n is a pointer to the value n elements away.
C. Pointer arithmetic is a short-hand notation that changes the value that a pointer is referencing.
D. Pointer arithmetic is valid only with pointers to arithmetic variables, such as pointer to integer.
E. Pointer arithmetic is valid only with the name of the array.


Answer: B

Computer Science & Information Technology

You might also like to view...

What is the value of the expression that follows?

strcmp(“dog”, “Dog”) a. -1 b. 0 c. 1 d. ‘\0’ e. none of the above

Computer Science & Information Technology

Display cout’s current precision setting.

What will be an ideal response?

Computer Science & Information Technology

When three hyphens, underscores, equal signs, asterisks, tildes, or number signs are typed and then the RETURN key is pressed, the AutoFormat feature ____.

A. places a border above a paragraph B. creates a numbered list C. changes the characters to an em dash D. creates a bulleted list

Computer Science & Information Technology

Which of the following refers to the encoding of information about the world into formats that artificial intelligence systems can understand?

A. Natural language processing B. Perception C. Knowledge representation D. Problem solving

Computer Science & Information Technology