Answer the following questions true (T) or false (F)
1. The C-string library function strcmp compares two strings for equal length.
2. To get a complete line of 70 or so character into a C-string is as simple as declaring a long enough C-string and then using the >> operator to extract the line from the input.
1. False
Explanation: This library function compares the first characters of the two strings with each other. In strcmp(s1, s2) if the first character of s1 is less than the first character of s2, then strcmp returns a result > 0 The reverse yields a value < 0..If characters are equal, the successive characters are examined. If the end of the strings is reached at the same index, the strings are equal, and strcmp returns 0 .
2. False
Explanation: This will lose the leading spaces, then get the first non-blank string entered at the keyboard. To do this task, use the cin member function getline. This function takes two arguments, a C-string and an integer count of the number of characters that you want in your C-string plus one more for the null terminator.
You might also like to view...
Which e-mail setting makes it easier for e-mail recipients to see who a message is from?
A) Field B) Emoticon C) Display name D) CAPTCHA
Use the ________ to customize the appearance and functionality of your computer and add or remove programs
A) Control Panel B) Index C) Quick access list D) Personal folder