Answered step by step
Verified Expert Solution
Link Copied!

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

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

More Books

Students also viewed these Databases questions

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago

Question

=+C&B (especially taxation) laws, regulations, and practices?

Answered: 1 week ago