Question: EXERCISES:C++ Langauge 1. (9%) What does this function do? a.Run the given code in HW6_Ex1.cpp and explain what this function does. b. Next explain the

EXERCISES:C++ Langauge

1. (9%) What does this function do?

a.Run the given code in HW6_Ex1.cpp and explain what this function does.

EXERCISES:C++ Langauge 1. (9%) What does this function do? a.Run the given

b. Next explain the code statement by statement (there are multiple statements in the for loop header). Putting together, your statement by statement explanation should explain how this function achieve its functionality.

// What does this function do?

void fun(char *s1, const char *s2)

{

while (*s1 != '\0')

s1++;

for (; *s1 = *s2; s1++, s2++)

;

} // end fun

HW6 Ex1.cpp- Notepad File Edit Format View Help // HW6_Ex1.cpp // CS225 // pointers to c-strings #include iostream // What does this function do? void fun (char *s1, const char *s2) while (*s1 != '\0') s1++ for (; *s1 *s2; s1++, s2++) // end fun int main) char str1[50]"Elizabeth"; // str1 char str2[20] "Mary"; // str2 = std::cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!