#include #include #include "cstring_vector.h" using namespace std; #define _CRT_SECURE_NO_WARNINGS char * readLine() { const int SIZE = 1024; char my_cstring[SIZE + 1]; // +1 - для нулевого байта cout << "Input string (" << SIZE << " characters at most): "; cin.getline(my_cstring, SIZE); // прочтёт максимум SIZE символов и // автоматически добавит 0 в конце //cout << "The string was: " << endl << my_cstring << endl; char * result = new char[cin.gcount()]; strcpy( result, my_cstring); return result; } cstring_vector ReadLines() { cstring_vector result; while (true) { auto s = readLine(); if (strcmp(s,"")==0) break; result.push_back(s); } return result; } int main() { cstring_vector ttt; ttt = ReadLines(); /*Input string (1024 characters at most): 12 Input string (1024 characters at most): cstring_vector move operator= invoked cstring_vector copy constr invoked*/ cstring_vector ttt1 = ReadLines(); //*nothing* #ifdef _WIN32 system("pause"); #endif //_WIN32 }