Exam 8: Pointers and Pointer-Based Strings

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Comparing pointers and performing pointer arithmetic on them is meaningless unless:

Free
(Multiple Choice)
4.9/5
(32)
Correct Answer:
Verified

A

A pointer can not be assigned to:

Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
Verified

C

A function that modifies an array by using pointer arithmetic such as ++ptr to process every value of the array should have a parameter that is:

Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
Verified

A

A string array:

(Multiple Choice)
4.7/5
(33)

Given that k is an integer array starting at location 2000, kPtr is a pointer to k and each integer is stored in 4 bytes of memory, what location does kPtr + 3 point to?

(Multiple Choice)
4.9/5
(34)

Which of the following is false for pointer-based strings?

(Multiple Choice)
4.8/5
(29)

Which of the following is false about a function to which a built-in array is being passed?

(Multiple Choice)
4.8/5
(28)

Which of the following best describes the array name n in the declaration int n[10];?

(Multiple Choice)
4.9/5
(36)

Assuming that t is an array and tPtr is a pointer to that array, which expression refers to the address of element 3 of the array?

(Multiple Choice)
4.9/5
(37)

(*max)(num1, num2, num3);:

(Multiple Choice)
4.9/5
(34)

The & operator can be applied to:

(Multiple Choice)
4.8/5
(28)

Which of the following statements about pointer initialization and values is false?

(Multiple Choice)
4.8/5
(32)

Which of the following can have a pointer as an operand?

(Multiple Choice)
5.0/5
(30)

All of the following can cause a fatal execution-time error except:

(Multiple Choice)
4.9/5
(40)

Pointers may be assigned which of the following values?

(Multiple Choice)
4.9/5
(30)

Consider the following function: void reverse(char *string1, const char *string2) { Int stringsize{sizeof(string1)/sizeof(char)}; *(string1 + stringsize - 1) = '\0'; String1 = string1 + stringsize - 2; For (; *string2 != '\0'; string1--, string2++) { *string1 = *string2; } } What technique does the function use to refer to array elements?

(Multiple Choice)
4.8/5
(27)

Which of the following gives the number of elements in the array int r[10]?

(Multiple Choice)
4.8/5
(32)

getline(superstring, 30); is equivalent to which of the following?

(Multiple Choice)
4.7/5
(37)

Given a built-in array of ints named values, which of the following statements would sort the array?

(Multiple Choice)
4.9/5
(32)

Which of the following is not a correct way to initialize a built-in array?

(Multiple Choice)
4.8/5
(30)
Showing 1 - 20 of 32
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)