Thank you integraft, for your answer, your the best!!!!
,that´s runnig.
just I have other question .what I need to change to my program stop just in the number of characters that the user have inputted.
for example:
if If we are allocating space for a 2 character string but the user
is giving us more. We need to stop at two characters
To get a string containing the first 2 characters from the original string.
1 2 3 4 5 6 7 8 9 10 11 12 13
#include <iostream>
#include <string>
int main()
{
std::string str = "Word";
// 0 is where to start copying from
// 2 is how many characters to copy to
std::cout << str.substr(0, 2) << '\n';
return 0;
}