107k views
5 votes
Declare a char array named line suitable for storing C-strings as large as 50 characters, and write a statement that reads in the next line of standard input into this array. (Assume no line of input is 50 or more characters.)

1 Answer

5 votes

Answer:

char line[50];

cin.get(line,50);

Step-by-step explanation:

The "char" data type stores character data in a fixed-length field.

User VJ Hil
by
7.2k points