his function is defined in the algorithm header file. The code given below describes the use of reverse()
function,
|
Output:
Use Of reverse()
strrev()
is a pre-defined function in C++, defined inside the cstring.h header file. It is extensively applicable for reversing any C-string(character array).
Further, it only requires the base address of the string as its argument and reverses the string accordingly. Let us see how we can use the strrev()
function in C++ to reverse strings.
|
Output: