Question: myString will be capable of holding a C - string with up to 9 9 characters before the terminating null character. Of course, myString can

myString will be capable of holding a C-string with up to 99 characters before the terminating null character. Of course, myString can hold a shorter C-string, too. For example, these assignments give myString the value "xyz". myString[0]='x';myString[1]='y';myString[2]='z';myString[3]='\0';It is legal to initialize a string variable, like this.char example[100]= "First value";Now, the string example[100] contains the following:--------------------------------------------------------------| F | i | r | s | t || v | a | l | u | e |\0|*|*|...--------------------------------------------------------------However, it is not legal to assign string variables, because you cannot assign to an entire array. myString ="xyz"; // ILLEGAL: Cannot assign to an arrayFurthermore, you cannot do comparisons like this.if (myString =="xyz") cout << "fantasy land" << endl; The comparison myString =="xyz" is actually legal (it will compile the addresses, not the strings!), but it will always evaluate to false. To handle these kinds of difficulties, programmers can rely on the C-string library (a

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!