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
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week