Which of the following string declarations is invalid?

A. char  str[9] = "Good Day";
B. char  str[ ] = "Good Day";
C. char  str = "Good Day";
D. char* str = "Good Day";


Answer: C

Computer Science & Information Technology

You might also like to view...

DDBMS must ensure that no two sites create a database object with the same name. One solution to this problem is to create a central name server. What are the disadvantages with this approach? Propose an alternative approach that overcomes these disadvantages.

What will be an ideal response?

Computer Science & Information Technology

A list method void add(int index, E x) seeking to add an element x that is an object of a class E to a list, should throw an IndexOutOfBoundsException when

A) the index is negative, or greater than the size of the list B) the index is negative, or greater than, or equal to, the size of the list C) the index is greater than or equal to the size of the list D) The element x falls outside of the bounds specified by the index

Computer Science & Information Technology

A copy of an original file, that can be used to restore information in the event of data loss

a. Copy b. Restore c. Backup

Computer Science & Information Technology

The motherboard form factor must match

A) The chipset B) The CPU C) The case D) The memory module design

Computer Science & Information Technology