Home » C++ String end() function

C++ String end() function

by Online Tutorials Library

C++ String end()

This function is used to return an iterator pointing to the last character of the string.

Syntax

Consider a string ‘str’ and an iterator ‘it’. Syntax would be:

Parameter

This function does not contain any parameter.

Return value

It returns an iterator pointing to the end of the string.

Example 1

Let’s see the simple example.

Output:

e  

Example 2

Let’s see an another simple example.

Output:

Welcome to TutorAspire 

Next TopicC++ Strings

You may also like