Which of the following defines the C-string containing “Hello”?
a. char stringVar[10] = “Hello”;
b. char stringVar[10] = {‘H’, ‘e’, ‘l’, ‘l’, ‘o’};
c. char stringVar[10] = {‘H’, ‘e’, ‘l’, ‘l’, ‘o’, ‘\0’};
d. char stringVar[6] = “Hello”;
e. char stringVar[] = “Hello”;
a) c) d) e)
Explanation: Note that a) and c) have the same size C-string variable and have the same size C-string. d) and e) have the same size C-string variable and have the same size C-string, but the size of the C-string variable is different from a) and c). The character array in b) is not terminated, so the array does not contain a C-string at all.
You might also like to view...
A property allows an object to remember one of its characteristics.
Answer the following statement true (T) or false (F)
A ____ is similar to a closing set of lines in a formal letter.
A. complimentary close B. salutation C. signature D. style
Match the PowerPoint 2010 feature with the group where they are located:
I. SmartArt A. Text group II. Convert to SmartArt Graphic B. Paragraph group III. WordArt C. Illustrations group IV. Color D. Arrange group V. Rotate E. Adjust group
The ____ protocol was designed by IBM to allow communication between IBM mainframe computers and any other types of computers that support SNA.
A. Systems Network Alliance B. Structured Network Architecture C. Systems Network Design D. Systems Network Architecture