"Improving the question "
Here is my array.
Is it correct syntax?
I need to get size of each subarray.
Then I like to retrieve specific subarray.
const QStringList list_array[10]
{
{ "SubWindow terminal all options ",
"SubWindow terminal configure ",
"SubWindow terminal setup ",
"SubWindow terminal connect serial ",
"SubWindow terminal connect Bluetooth ",
"SubWindow terminal DEBUG / TRACE ",
"SubWindow terminal connect Bluetooth ",
"SubWindow terminal DEBUG / TRACE ",
"SubWindow terminal LAST member "
},
{ "SubsubWindow bluetoothctl help (QMdiArea )",
"SubsubWindow bluetoothctl list (QMdiArea )",
"SubsubWindow bluetoothctl devices (QMdiArea )",
"SubsubWindow bluetoothctl show (QMdiArea )" },
{ "SubWindow terminal (QMdiArea )",
"SubWindow hcitool (QMdiArea )",
"SubWindow bluetoothctl (QMdiArea )",
"SubWindow system (QMdiArea )" },
{ "SubsubWindow bluetoothctl help (QMdiArea )",
"SubsubWindow bluetoothctl list (QMdiArea )",
"SubsubWindow bluetoothctl devices (QMdiArea )",
"SubsubWindow bluetoothctl show (QMdiArea )" },
{ "SubsubWindow hcitool (QMdiArea )",
"SubsubWindow hcitool dev (QMdiArea )",
"SubsubWindow hcitool scan (QMdiArea )",
"SubsubWindow hcitool inq (QMdiArea )",
"SubWindow system LAST array member (QMdiArea )"
}
};
My test code
for(int TEST = 0; TEST < 5; TEST++)
{
text = " test ARRAY size TEST ";
text += QString::number (TEST );
text += " ";
text += QString::number (list_array[TEST][0].size());
text += " sizeof ";
text += QString::number (sizeof (list_array[TEST]));
qDebug() << text;
}
My test code result
" test ARRAY size TEST 0 39 sizeof 8"
" test ARRAY size TEST 1 49 sizeof 8"
" test ARRAY size TEST 2 34 sizeof 8"
" test ARRAY size TEST 3 49 sizeof 8"
" test ARRAY size TEST 4 39 sizeof 8"
With index = 0, the list_array[index].size(); return correct size of main (string) array,
with index = 0 and "sub array = 0 "
the list_array[index][0].size(); returns first member of main array count of characters.
I am after size of the first sub array.
int subSize = list_array[index].size();
int subsubSize = list_array[index][0].size();
What I have tried:
I did try to vary the index - but that seems silly....( just to satisfy the counter )