string

first we enter the name in string then we separate that name character by character then we encrypt its each character by adding 3 character in it then it give us output after encrypt in it . how this used in c++?
Not really sure what you're asking
Yea not very clear.

is this what you are talking about?

1
2
3
4
5
6
    std::string str = "HelloWorld";
    std::cout << "Before: " << str << std::endl;
    for(std::string::size_type i = 0; i < str.length(); ++i) {
        str.insert(++i,"3");
    }
    std::cout << "After: " << str << std::endl;


this produces:

1
2
Before: HelloWorld
After: H3e3l3l3o3W3o3r3l3d3
Topic archived. No new replies allowed.