C++ String cbegin()It gives a reference to the first element of the string. Difference b/w cbegin() and begin()The only difference between cbegin() and begin() is cbegin() returns the constant iterator pointing to the constant value. SyntaxConsider a string str. Its syntax would be: ParameterThis function does not contain any parameter. Return valueThis function returns the reference pointing to the first element of the string. Example 1Let's see a simple example: In this example, string 'java tutorial' is displayed using cbegin() function. Output: java tutorial Example 2Let's see another simple example: Output: 12345 In this example, vector containing integer values are displayed using cbegin(). Next TopicC++ Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India