Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Review Questions fill in the blank. Please answer all to the best of your ab

ID: 3829939 • Letter: C

Question

C++ Review Questions fill in the blank. Please answer all to the best of your ability! Thank you!

1.) What will the following code output?
int *numbers = new int[5];
for (int i = 0; i <= 4; i++)
  *(numbers + i) = i;
cout << numbers[2] << endl;

2.) Closing a file causes any unsaved information still held in the file buffer to be
________.

3.) This function will return true if its argument is a printable character other than a
digit, letter, or space.

4.) What will the following code output?
int number = 22;
int *var = &number;
cout << *var << endl;

5.) Members of a(n) ________ union have names, but the union itself has no name.

6.) Look at the following code:
int numbers[] = {0, 1, 2, 3, 4 };
int *ptr = numbers;
ptr++;
After this code executes, which of the following statements is true?

7.) This function accepts a C-string as an argument and converts the string to a long
integer.

8.) When used by itself, this access flag causes a file's contents to be deleted if the file
already exists.

9.) This is like a structure, except all members occupy the same memory area.

Explanation / Answer

1.) What will the following code output?
int *numbers = new int[5];
for (int i = 0; i <= 4; i++)
  *(numbers + i) = i;
cout << numbers[2] << endl;

numbers[2] = 2

2.) Closing a file causes any unsaved information still held in the file buffer to be a) saved to the file
3) This function will return true if its argument is a printable character other than a
digit, letter, or space.is punct:
4) 22
5)
Members of a(n) anonymous union have names, but the union itself has no name.

6.)ptr will hold the address of numbers[1]


7.) This function accepts a C-string as an argument and converts the string to a long
integer. : atol

8) ios::out

9)union

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote