Pointers And References In C Plus Plus - Study Mode

[#51] What is the output of the following code: char str[] = "Hello"

cout << sizeof(str)

in C++?
Correct Answer

(D) 6

[#52] What is the output of the following code: int arr[3] = {1, 2, 3}

cout << *(arr + 2)

in C++?
Correct Answer

(C) 3

[#53] What is the output of the following code: int arr[3] = {1, 2, 3}

int *ptr = arr

cout << *(ptr + 1)

in C++?
Correct Answer

(C) 2

[#54] What is the output of the following code: int arr[] = {1, 2, 3}

cout << *arr

in C++?
Correct Answer

(A) 1

[#55] How do you declare a constant pointer to an integer variable in C++?
Correct Answer

(D) int *const ptr