C++ String crbegin() function
Last Updated : 17 Mar 2025
The crbegin() function stands for 'reverse beginning'. This function references to the last character of the string.
Syntax
Consider a string str. Syntax would be:
Parameter
This function does not contain any parameter.
Return value
This function returns the constant iterator pointing to the last character of the string.
Example 1
Let's see the simple example of crbegin() function:
Output:
This example shows how to reverse the string using crbegin() function.
Example 2
Output:
This example shows how to get the reverse list using crbegin() function.