What happens if you forget to place a null character in a character array and then write the array using cout?

What will be an ideal response?


The cout object will continue to write characters to the screen until it sees a NULL character ‘\0’.

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. The keyword private is an access specifier. b. Access specifiers are always followed by a semicolon (;). c. A private data member is accessible only to its class’s member functions. d. Most data-member declarations appear after the private access specifier.

Computer Science & Information Technology

Consider the function definition and array declarations. Which are incorrect calls to the function make_2? Why?

(In considering this code, you are to ignore the a) b), and so on, at the start of the lines, and consider that this code is to be embedded in a complete and correct program.) ``` void make_2 ( int a[], int size ) { for (int i = 0; i < size; i++ ) a[i] = 2; } int array1[20]; a) make_2( array, 30 ); b) make_2( array, 10 <

Computer Science & Information Technology

Java provides two Collections classes that can be used to implement stacks. They are ______ and _____.

a) the Stack class, the LinkedList class b) one-dimensional arrays, multidimensional arrays c) Exceptions, Errors d) data structures, list structures e) none of the above

Computer Science & Information Technology

A card is drawn from a standard deck of playing cards. What is the probability that the card is a red face card?

A.
B.
C.
D.
E.

Computer Science & Information Technology