Which of the following correctly initializes the name array

Which of the following correctly initializes the name array with the name Jack Jones?

A. char name[15]= \"Jack Jones\"; B, char name[ ]= \"Jack Jones\"; C. char name[ ] = {\'J\',\'a\',\'c\', \'k\', \' \', \'J\', \'o\', \'n\',\'e\',\'s\', \'\\0\'}; D. All of the above.

Solution

only A is true.

C becomes true if char name[15]= {\'J\',\'a\',\'c\', \'k\', \' \', \'J\', \'o\', \'n\',\'e\',\'s\', \'\\0\'};

and if B follows A

Which of the following correctly initializes the name array with the name Jack Jones? A. char name[15]= \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site