Question: Character Pointers and string coding in c++ Problem 4: C String, character pointer to string Write a program that takes string as input from the

Character Pointers and string coding in c++

Character Pointers and string coding in c++ Problem 4: C String, character

Problem 4: C String, character pointer to string Write a program that takes string as input from the user (the number of characters should be more than three). Assign this string to character pointer. . Print the mid two characters of the string (if length of the string is even) .Print mid three characters of the string (if length of the string is odd) string midChar(char* charPtr, int n); Examples a. midChar("Bibimbap", 8) - "im" b. midChar("Ddukbokki", 9) -> "kbo" OUTPUT ter a string: Bibimbap idCharacters are: im er a string: Ddukbokki idcharacters are: kbo

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!