129k views
5 votes
Which of the following correctly declares name to be a character array and stores "William" in it?

A) char name[6] = "William";
B) char name[7] = "William";
C) char name[8] = "William";
D) char name[8] = 'William';

User MBober
by
3.7k points

1 Answer

3 votes

char name[8] = "William"; is the correct answer.

User Maxadorable
by
3.3k points