Anything wrong with this?

I want to know what questions I've answered are incorrect.
Please mark the ones that are incorrect...and maybe a correction? Here are the questions:
----------------------------------------------------------------------------------------------------------------
1) The word _____const_____ is used before the array declaration in a function heading to prevent the function from modifying the array.

2) The following statement creates alpha to be a two-dimensional array with _____10_____ rows.

int alpha[10][25];

3) A data type is called _____simple_____ if variables of that type can store only one value at a time.

4) A data type wherein you directly specify values in the variable declaration with no type name is called a(n) _____anonymous_____type.

5) The statement strlen("Marylin Stewart"); returns _____15_____.

6) Two (or more) arrays are called _____parallel_____ if their corresponding components hold related information.

7) If a global identifier in a program has the same name as one of the global identifiers in the header file, the compiler generates a(n) _____syntax_____ error.

8) Suppose str = "abcd". After the statement str = str + "ABCD"; the value of str is "_____abcd+ABCD_____".

9) Suppose that str1 and str2 are string variables. After the following statements execute, the value of str2 is "_____abc-xyz_____".

str1 = "abc";
str2 = str1 + '-';
str2 = str2 + "xyz";

10) The string expression strVar._____insert(pos, str);_____ inserts all the characters of str at index pos into strVar.

11) An enumeration type can be passed as a parameter to a function only by value.
*Answer: True

12) When you pass an array as a parameter, the base address of the actual array is passed to the formal parameter.
*Answer: True

13) Suppose list is a one dimensional array of size 25, wherein each component is of type int. Further, suppose that sum is an int variable. The following for loop correctly finds the sum of the elements of list.

sum = 0;

for (int i = 0; i < 25; i++)
sum = sum + list;
*Answer: False

14) The following statement creates an anonymous type:

enum {1ST, 2ND, 3RD, 4TH} places;
*Answer: True

15) The general syntax for accessing a namespace member is: namespace_name->identifier.
*Answer: True

16) The following is a legal C++ enumeration type:

enum colorType {BLUE, GREEN, PINK, YELLOW, RED};
*Answer: True

17) The statement int list[25]; declares list to be an array of 26 components, since the array index starts at 0.
*Answer: True

18) In C++, [] is called the array subscript operator.
*Answer: True

19) All components of an array are of the same data type.
*Answer: True

20) No arithmetic operations are allowed on the enumeration type.
*Answer: True

21) An anonymous type can be passed as a parameter to a function.
*Answer: False

22) Arrays can be passed as parameters to a function by value, but it is faster to pass them by reference.
*Answer: False

23) Given the declaration int list[20]; the statement list[12] = list[5] + list[7]; updates the content of the twelfth component of the array list.
*Answer: True

24) In a two-dimensional array, the elements are arranged in a table form.
*Answer: True

25) If an array index goes out of bounds, the program always terminates in an error.
*Answer: True

26) In C++, namespace is a reserved word.
*Answer: True

27) The following is a valid C++ enumeration type:

enum places {1ST, 2ND, 3RD, 4TH};.
*Answer: False

28) A function cannot return the value of an enumeration type.
*Answer: False

29) The one place where C++ allows aggregate operations on arrays is the input and output of C-strings.
*Answer: True

30) The array index can be any integer less than the array size.
*Answer: True
Last edited on
Topic archived. No new replies allowed.