Answer the question
In order to leave comments, you need to log in
One two-dimensional or two one-dimensional arrays?
Hi Toaster!
There are three types of information (First Name, Last Name, Patronymic), they need to be sorted for further use.
What to choose? One multi-dimensional array or many one-dimensional ones?
// создаем одномерные массивы
string *name = new int [1000];
string *s_name = new int [1000];
string *m_name = new int [1000];
// OR
string **full_name = new string* [3];
for (int i = 0; i < 3; i++) {
full_name[ш] = new string [1000]; // создаем двумерный массив
}
// ... операции над массивами (склеивание строк, поиск подстроки) ...
// Очистка памяти
delete [] name;
delete [] s_name;
delete [] m_name;
for (int i = 0; i < 3; i++) {
delete [] full_name[i]; // удаляем двумерный массив
}
Answer the question
In order to leave comments, you need to log in
What to choose?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question