Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve those two questions. It's C++ language 3. In the following code fragment; string a - hello; string b - a; string * -

image text in transcribed

Please solve those two questions. It's C++ language

3. In the following code fragment; string a - "hello"; string b - a; string * - &a; string &d - *C; string e-*c; How many instances of the string type exist in memory? Draw a picture of automatic storage for these variables. 4. Ada is writing several functions that each accept a string parameter. For each function description, decide if the function should accept its parameter as a string, a strings, a string&, or a const string&: (a) In Funca, Ada will read individual characters from the string to make a computation. She will not mutate the string- (b) In FuncB, Ada will mutate the string parameter, but doesn't want the original string passed to the function to mutate. (c) In Funcc, Ada will mutate the string parameter, and the string cannot be "null": nullptr. (d) In FuncD, Ada does not want to duplicate the string passed to the function, and is prepared to handle a null value as well

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

Students also viewed these Databases questions

Question

What is the role of communication (Chapter 4) in leadership?

Answered: 1 week ago