I want to create a string of any size, that is, not to create a constant, in often:
const int max_size_str = 256; But count the number of characters from the input buffer entered before '\ n' + 1 (for \ 0) and write as the size of the line so that you can specify the size of the line by the number of characters entered.
I am aware of how to use dynamic memory. I give an example of my question, I do not specify the size of the array of characters, I write a string from the keyboard, after which the number of characters in this string is considered and a dynamic array of characters is created, and then from the input buffer, what I wrote there (the string) is copied into the created array is then added with a 0 at the end to read as a string.
std::getline(std::cin, s);- eanmos