I am working on a study guide for a final exam for my C++ class and would like a
ID: 3581462 • Letter: I
Question
I am working on a study guide for a final exam for my C++ class and would like a second opinion on the answers to the study guide questions since I do not have an answer key.
Short Answer:
1)All c-strings must be terminated by ________
2) To compare two c-strings you use the __________ function.
3)To use the functions for manipulating and comparing c-strings, you must include ___________
4)What is the c-string function to determine the number of characters in a c-string?
5) What is the name of the function to convert from a c-string that contains only digits to an integer?
6)The c-string to number conversion functions are in the _________ library.
7)The ________ class lets you treat string values and variables like other pre-defined data types (such as int).
8)How do you concatenate two string values (str1, str2)?
9)What is the code to print out the third character in a string variable named str?
10)Which string function returns the first occurrence of str1 in a string named str?
11) ____________ can be thought of as an array that can grow and shrink as needed.
Explanation / Answer
Answers:
1)All c-strings must be terminated by ____''____
2) To compare two c-strings you use the ___strcmp()_______ function.
3)To use the functions for manipulating and comparing c-strings, you must include __string.h_________
4)What is the c-string function to determine the number of characters in a c-string? strlen()
5) What is the name of the function to convert from a c-string that contains only digits to an integer? atoi()
6)The c-string to number conversion functions are in the __stdlib.h_______ library.
7)The __string______ class lets you treat string values and variables like other pre-defined data types (such as int).
8)How do you concatenate two string values (str1, str2)? str1 + str2
9)What is the code to print out the third character in a string variable named str? str[2] since string elements start from 0 so 3rd character exists in 2nd index in str
10)Which string function returns the first occurrence of str1 in a string named str? find function
11) _____vector_______ can be thought of as an array that can grow and shrink as needed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.