i dont understand how it printing each element of whole string.like L a s.but i did not declared array.how is this possible explain me detialy please .thank you in advance
> dont understand how it printing each element of whole string.like L a s.
> but i did not declared array.
Yes, you did not declare an array; std::string is not an array; it is a user defined type provided by the library.
The type has an overloaded subscript operator, so [] can be be used on objects of type std::string http://www.cplusplus.com/reference/string/string/operator[]