Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please, I'm stuck in this c++ code. I just need to fill in the functions. Thank you LAB: C++/C common string functions part 2 reverse,

Please, I'm stuck in this c++ code. I just need to fill in the functions. Thank you image text in transcribed
image text in transcribed
LAB: C++/C common string functions part 2 reverse, reverse-new-strchr_ strrch, strnca, strstr replace , replace-str Code and Algorithm Design This lab, based on K and R (aka: THE C PROGRAMMING LANGUAGE by Kernighan 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 (charq reverse a string in ptace 7 nake a new string that 1s rever tind the first occurrence o tind the last occurrence of char reverse_ new_(const char) char strehr_ (char* s, char c): char strrchr (char* s. char c): . 11 concatenate up to n characters from t onto the end of s char strecat (char s, const chart, size t n): char, strstr (char s, const char t: find the first occurrence of string t in s ar* replace_ (char.s,char c. char d): replace all occurrences of c withd eplace all occurrences of substring t with new substring u r-(char" s. char* t. char* u): All of these functions should be implemented with pointers. Students will also show each of the algorithms using spreadsheets (as in the previous lab), Don't forget to check and needed. #ine luce #include lt Reverse string q in place char. reverse (char o // fill in code here Il Make a now string that is the reverse of string q-don't forget to fi11 in code here deleto@ it in main ll Find the first occurrence of c in s char strchr_(char s. char c): ril in code here Il Find the last occurrence of c in s rill in code here l Concatenate up to n characters of t onto s fill in code here Il Find the first occurrence of string t in s till in code here Il Replace all occurrences of c with d char strrchr_(char s. char c) char strncat_(char s, const char* t, size t n)I this will help you on replace str char* strstr (char s. const char* t) char replace (char s, char c, char d) / fill in code here ll Replace all occurrences of string t with string u Hint: make a temporary buffer that is the sane as s page 1 of 2 McCarthy

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

Professional Microsoft SQL Server 2012 Administration

Authors: Adam Jorgensen, Steven Wort

1st Edition

1118106881, 9781118106884

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago