Been in C#-land for a while and I can't work out how to do this in C++ (in an Arduino sketch)
I would like to call a function from a library that returns a list of bytes of unknown length. Sort of like this:
byte devices[] = MyLib::EnumerateDevices();
And in the library:
byte[] MyLib::EnumerateDevices()
{
int count = 0;
//some code that modifies count
static byte *temp = new byte[count]; // Assume count is 2 here
temp[0] = 42;
temp[1] = 44;
return temp;
}
Obviously I have all me pointers and derefs either missing or in the wrong place...
Help?
Dave