Dec 4, 2022 at 8:18am Dec 4, 2022 at 8:18am UTC
You mean a vector of vectors?
1 2 3 4 5 6
vector<vector<uint8_t>> hex_vectors =
{
{ 0x31 },
{ 0x41 },
{ 0x61, 0x6c, 0xba, 0xd6, 0x49 },
};
Then you can loop over the vectors using a regular for loop.
1 2 3 4
for (size_t i = 0; i < hex_vectors.size(); ++i)
{
cout << EncodeBase58(hex_vectors[i], mapping) << "\n" ;
}
Or you could use a range-based for loop.
1 2 3 4
for (const vector<uint8_t>& hv : hex_vectors)
{
cout << EncodeBase58(hv, mapping) << "\n" ;
}
Last edited on Dec 4, 2022 at 8:26am Dec 4, 2022 at 8:26am UTC
Dec 4, 2022 at 5:38pm Dec 4, 2022 at 5:38pm UTC
I did not know that I wanted a vector of vectors, but that does work. I used the option: for( size_t i = 9; ... )
Its a bit more cumbersome than a double indexed array, but it did the job for me.
Thank you for your time.
Last edited on Dec 4, 2022 at 5:39pm Dec 4, 2022 at 5:39pm UTC