Question: C + + Part 2 : Manipulating C - Strings Create a function named part 2 that is invoked from the main function

C++\\ Part 2: Manipulating C-Strings
Create a function named part2 that is invoked from the main function and the prototype is void part2(). Write function body with the following requirements:
Declare the following two variables:
char *original = new char[50];
char copyStr[50];
Read user input into original and copyStr by calling getline() and display the contents of both Original and copyStr.
Print the number of characters in original and copyStr.
Compare the original string to copyStr, then display whether these two strings are same or not.
Copy the content of the original variable into copyStr, then display the values of copyStr.
C + + \ \ Part 2 : Manipulating C - Strings

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 Programming Questions!