Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a strtrim function using the provided interface that trims the whitespace off the front and back of any null terminated cstring. Must work on
Write a strtrim function using the provided interface that trims the whitespace off the front and back of any null terminated cstring. Must work on all strings including but not limited to nullptr, empty strings, and lank strings. The function must work with heap allocated strings. The return must be identical to the input parameter. Be sure your function passes the provided test cases Your strtrim function may only use methods found in the following headers: #include \ #include \ You may use the cstring header, but only if you pay very close attention. nullptr, "Hello, world!", "whitespace", "whitespace right "whitespace left" " \t tab \t ", " r crlf ", " The quick brownInltvrlffox jumps over the lazy dog. \b ", "Here comes the rain again", "Falling on my head like a memory", "Falling on my head like a new emotion", "I want to walk in the open wind", "I want to talk like lovers do" "I want to dive into your ocean", "Is it raining with you" 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started