I would like to know how to access a
string = "hello you";
with
char a;
I would like for an example take out the first l and the y, then change the character value to
char a={a+2};
so the changes also will permit in the string which the characters has been taken from.
#include <iostream>
#include <string>
#include <cctype>
int main()
{
std::string s = "hello you";
std::cout << s << std::endl;
for ( char &c : s ) c = std::toupper( c );
std::cout << s << std::endl;
for ( std::string::size_type i = 0; i < s.size(); i++ ) s[i] = std::tolower( s[i] );
std::cout << s << std::endl;
}