Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could anyone give me some ideas to do the exercise's question below? Exercises 1. Write the below function that is given a Cstyle string and

Could anyone give me some ideas to do the exercise's question below?

image text in transcribed
Exercises 1. Write the below function that is given a Cstyle string and computes the length of the string int stringLength(char* string); 2. Write a C++ Program to test the function you wrote in the above question. (a) What steps should be in your program? For example, do you need a string? Where does that sting come from? Should you create memory for this string on the stack or the heap? (b) What are important test cases that you should consider? For example, should how long should the string be? What characters should be in the string? What are the edge cases, such as an \"empty strin '? 3. Write the below function that is given a Cstyle string in arc and copies the contents of src into dest. You may assume that dest has enough memory allocated to t all of the characters in are. void copyString(chaI* src, chart dest); 4. Write a C++ Program to test the function you wrote in the above question. As with question 2, consider the types of things that your C++ program should do. However, you may need extra steps such as: (a) Did you set aside enough memory for dest? (b) Should the memory for dest be on the stack or the heap? (c) What happens if src is has a length of zero

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

How can an entrepreneur launching a new business forecast sales?

Answered: 1 week ago