Write a function that takes a C string as an input parameter and reverses the string. The function should use two pointers, front and rear. The front pointer should initially reference the first character in the string, and the rear pointer should initially reference the last character in the string. Reverse the string by swapping the characters referenced by front and rear, then increment front to point to the next character and decrement rear to point to the preceding character, and so on, until the entire string is reversed. Write a main
Want to see the full answer?
Check out a sample textbook solutionChapter 9 Solutions
Problem Solving with C++ (9th Edition)
Additional Engineering Textbook Solutions
Artificial Intelligence: A Modern Approach
Software Engineering (10th Edition)
Database Concepts (8th Edition)
Starting out with Visual C# (4th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
Starting Out with Java: Early Objects (6th Edition)
- In c++ Write a function that receives a string containing a 16-bit binary integer. The function must return the string’s integer value. Write a function that receives a string containing a 32-bit hexadecimal integer. The function must return the string’s integer value. Write a function that receives an integer. The function must return a string containing the binary representation of the integer. Write a function that receives an integer. The function must return a string containing the hexadecimal representation of the integer. Write a function that adds two hexadecimal strings, each as long as 1,000 digits. Return a hexadecimal string that represents the sum of the inputs.arrow_forwardWrite a function which will take 2 arguments. They are: Sentence position Your first task is to take these arguments as user input and pass these values to the function parameters. Your second task is to implement the function and remove the characters at the index number which is divisible by the position (Avoid the index number 0 as it will always be divisible by the position, so no need to remove the index 0 character). Finally, add the removed characters at the end of the new string. Return the value and then finally, print the new string at the function call. ===================================================== Input:"I love programming."3Function call:function_name("I love programming.", 3)Output:I lveprgrmmngo oai. ============================================== Input:"Python is easy to learn. I love python."6Function call:function_name("Python is easy to learn. I love python.", 6)Output:Pythonis eay to earn.I lov pythn. sl eoarrow_forwardIn C++, Write a function that receives a string of characters and return true if the string is in language, otherwise it returns false. You may use following function header (Assume a string is in language if it is read from the left side is the same as it is read from the right side. For example, a-b-d-c is not in the language, a-b-c-a-c-b-a is in language): bool isInLanguage_2(string aString) And I also, want to know if my if statement is incorrect, and if it is how is it incorrect?arrow_forward
- Complete the process_name() function that takes a single string parameter name. You can assume that the name will always be in the format first name surname with a single space character between the first name and the surname. The function returns a string consisting of the first letter of the first name followed by the first three letters of the surname. All of the characters in the returned string should be in lowercase. Some examples of the function being used are shown below: For example: Test Result print(process_name("Damir Azhar")) dazh print(process_name("Ann Cameron")) acam Answer: (penalty regime: 0 %) Reset answer 1v def process_name (name): 2arrow_forwardPlease Help C++ Write a function that returns an integer and accepts a pointer to a C-string as an argument. The function should count the number of characters in the string and return that number. Demonstrate the function in a simple program that asks the user to input a string, passes it to the function, and then displays the function’s return value.arrow_forwardWrite it in pythonarrow_forward
- write a python program 9. You are a class teacher at a kindergarten school. As a task, you asked your students to write a paragraph. Unfortunately, you notice that most of the students did not use capital letters correctly. Your task is to write a function which takes a string as its only parameter and returns a new copy of the string that has been correctly capitalized. Your function should: Capitalize the first letter in the string Capitalize the first letter after a full-stop, exclamation mark or question mark • Capitalize the word “i" if it is in lowercase. Summary: You have to write a function that reads a string from the user and capitalizes. The string is then returned and displayed. Sample Input ('my favourite animal is a dog. a dog has sharp teeth so that it can eat flesh very easily. do you know my pet dog's name? i love my pet very much.') Sample Output My favourite animal is a dog. A dog has sharp teeth so that it can eat flesh very easily. Do you know my pet dog's name? I…arrow_forwardWrite a C function findDigit() that takes a string as a parameter, finds and returns the address of the first numeric character ('0'-'9') in the string.arrow_forwardCould you code this for me?arrow_forward
- This is for my C++ 2 class, so still a beginner C++ program: Case Manipulator Write a program with three functions: upper, lower, and flip. The upper function should accept a C-string as an argument. It should step through all the characters in the string, converting each to uppercase. The lower function, too, should accept a pointer to a C-string as an argument. It should step through all the characters in the string, converting each to lowercase. Like upper and lower, flip should also accept a C-string. As it steps through the string, it should test each character to determine whether it is upper- or lowercase. If a character is uppercase, it should be converted to lowercase. If a character is lowercase, it should be converted to uppercase. Test the functions by asking for a string in function main, then passing it to them in the following order: flip, lower, and upper.arrow_forwardin C program pleasearrow_forwardWrite a function that accepts either a pointer to a C-string, or a string object, as its argument. The function should return the character that appears most frequently in the string. Demonstrate the function in a complete program.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr