Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Develop a solid understanding of C-strings, and how each std::string object is a wrapper around a C string Practice with pointer operations in C++, e.g.
-
Develop a solid understanding of C-strings, and how each std::string object is a wrapper around a C string
-
Practice with pointer operations in C++, e.g. dereferencing, treating them as arrays (and vice versa), etc.
-
You may not use any #include directives. Rather, take this opportunity to write pure C++, without the use of any library functions/classes/etc.
#ifndef CS19_C_STRINGS_H_ #define CS19_C_STRINGS_H_ namespace cs19 {
/** * Composes an output C-string with alternating characters from two other strings. * * @param str1 the first source string * @param str2 the second source string * @param[out] output filled with characters from str1 and str2, alternating between the two. The * length of this array is assumed to be at least strlen(str1) + strlen(str2) + 1. */ void strzip(const char *str1, const char *str2, char *output) { // TODO } /** * Performs the ROT13 encoding on a C-string, in place. The ROT13 encoding simply shifts every * English letter by 13 places in the alphabet while leaving non-English-alpha characters untouched. * Encoding and decoding are done by the same function: Passing an encoded string as argument will * return the original version. * * @return a pointer to the encoded string */ char *str_rot13(char *str) { // TODO } } // namespace cs19 #endif
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