in c++
Write a function that takes a C string as an input parameter andreverses the string. The function should use two pointers, frontand rear. The front pointer should initially reference the firstcharacter in the string, and the rear pointer should initiallyreference the last character in the string. Reverse the string byswapping the characters referenced by front and rear, thenincrement front to point to the next character and decrement rearto point to the preceding character, and so on, until the entirestring is reversed. Write a main program to test your function onvarious strings of both even and odd length.