Answer to Question #340867 in C++ for Salama

Question #340867

// Ex . 8.13 : ex08_13.cpp

// What does this program do ? 

#include < iostream > 

using namespace std ; 


void mystery1 ( char *, const char * ) ; // prototype 

 

int main ( ) 

  char string1 [ 80 ] ; 

  char string2 [ 80 ] ; 

  cout << " Enter two strings : "; 

  cin >> string1 >> string2 ; 

  mystery1 ( string1, string2 ) ; 

  cout << string1 << endl ; 

} // end main 


  // What does this function do ? 

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

  while ( * s1 ! = '\0' ) 

   

   

    ++ s1 ; 


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

    ; / / empty statement 

} // end function mystery1


1
Expert's answer
2022-05-16T18:33:02-0400

What does this program do ? The program concatenates strings.            


What does this function do ? The function copies string s2 into string s1.


Output:

Enter two strings : Str1 Str2

Str1Str2


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS