Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help filling in the codes for this program. C++ LAB: C++/C common string functions part 2: reverse, reverse new strchr strrchr, strncat strstrreplace,

I need help filling in the codes for this program. C++ image text in transcribed
image text in transcribed
LAB: C++/C common string functions part 2: reverse, reverse new strchr strrchr, strncat strstrreplace, replace str Code and Algorithm Design This lab, based on K and R (aka: THE C PROGRAMMING LANGUAGE by Kemighan and Ritchie). is designed to give more practice in working with common C library functions used in C++C (please refer to Chapter 5.5 when needed, or related sections (marked in the text). char reverse (char* q): char reverse_new (const char q) / make a new string that is reversed char strchr_(chars, char c): char strrchr (char s, char c): /I reverse a string in place / find the first occurrence of c find the last occurrence of c .II concatenate up to n characters from t onto the end ofs char strncat (char* s. const char* t. size t n): char replace (char s. char c, char d); I replace all occurrences of c with d char replace str_(char s. char t.char u): .1 replace alt occurrences of substring t with new substring u All of these functions should be imalemented with pointers. Students will also show each of the algorithms using spreadsheets (as in the previous lab). Don't forget to check: when needed. nclude #include W Reverse string q in place fill in code here l Make a new string that is the reverse of string q-don't forget to deleteD it in main ti11 in code here N Find the first occurrence of c in s fill in code here W Find the last occurrence of c in s char reverse_(char* q) char reverse_new_(char q) char strchr_(char' s. char c): char strrchr_(char s. char c) t rill in code here Il Concatenate up to n characters of t onto s char strncat (char s, const char t. size tn) ( I/ this will help you on replace str till in code here Find the first occurrence of string t in s fill in code here l Replace all occurrences of c with d fill in code here l Replace all occurrences of string t with string u char strstr(char s, const char* t) char replace (char s. char c, char d) ( / Hint: make a temporary buffer that is the same as s page 1 of 2

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions

Question

List the steps in the succession management process.

Answered: 1 week ago

Question

7. How might you go about testing these assumptions?

Answered: 1 week ago