Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The size() member function in the string starts remote runs in C++ returns the a

ID: 3692477 • Letter: T

Question

The size() member function in the string starts remote runs in C++ returns the address of a string returns the address of a long variable returns the length of the contents in the string which of the following data has been sorted already an array with random number a link list with random number a binary tree a binary search tree The substr () function in string class is used for: return one part of current string replace the content of current string insert new content into current string search content from current string none of the above

Explanation / Answer

11. the size() function in c++ is a member function of strings. it returns the length of the string in bytes ( not the actual bytes of datatype but the bytes that are in the actual string).

eg: string str ("demo string");

couit<<"the size of the string is"<<str.size();

which returns 11

12. the answer is binary search tree as in binary tree you only have a tree with the condition that each node should have two children at maximum, which also has the features of sorted array and a linked list. whereas the binary search tree shows a special behaviour where in the condition that the left child must be always less than the parent and the right child must be always greater than the parent.

13. the substr() returns a portion of the string based on the start position and end position specified (start position and end position are the parameters).

its syntax can be

String substr(int start_index, int end_index)

so the answer is a) returns one part of current string

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote