Windows 11, Visual Studio 2022, C++
I know basic C/C++ but not vectors.
I found code that does base58 encoding. The function is declared as:
|
std::string EncodeBase58(const std::vector<uint8_t>& data, const uint8_t* mapping)
|
The encoded string is left in the return value, moderately sure of that.
The input below is to be the first argument in the format: hex_to_encode[ i ]
The code will loop through and encode each array into the string.
1 2 3 4 5 6
|
uint8_t hex_to_encode[ test_array_count ] [ test_array_max_length ] =
{
{ 0x31 },
{ 0x41 },
{ 0x61, 0x6c, 0xba, 0xd6, 0x49 },
… };
|
But now that I get ready to post, I realize the size of the array is not supplied. Is that part of inputting a vector?
I tried this:
1 2
|
vector<uint8_t> hex_vector[ test_array_count ] [ test_array_max_length ] =
{ { 0x31 }, … };
|
This seems to me to match the format of several examples I googled up. But it complains about no suitable constructor. I don’t know one either.
How do I present this data to the function so that it will be accepted.