Question: Which is true for the following code? char userText [ 1 0 ] ; userText [ 0 ] = ' B ' ; userText [

Which is true for the following code?
char userText [10];
userText [0]='B';
userText [1]='o';
userText [2]='o';
userText [3]='k';
userText[4]='??0';
userText [3]='t';
The compiler generates an error because element 3 can't be overwritten.
The first four characters of the array userText are Book.
Printing the array userText will work fine because the new string is 4 characters and the array size is 10.
The first five characters of the array userText are Bookt.
 Which is true for the following code? char userText [10]; userText

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!