Javatpoint Logo
Javatpoint Logo

C++ String at()

This function is used for accessing individual characters.


Consider a string str. To find the position of a particular character, its syntax would be


pos : It defines the position of the character within the string.

Return value

It returns the character specified at that position.

Example 1


String contains Welcome to javatpoint tutorial

Example shows that we can access the characters by using either the member function at() or the subscript operator[ ].

Next TopicC++ Strings

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA