I’m trying to retrieve an element from a StringArray pointer and having troubles. I’ve searched the juce files for StringArray pointers as examples without much luck.
I get this error:
error C2664: ‘outputDebugString’ : cannot convert parameter 1 from ‘class juce::StringArray’ to 'const class juce::String &'
Reason: cannot convert from ‘class juce::StringArray’ to ‘const class juce::String’
StringArray* array = new StringArray();
String values = "1 2 3 4 5 6";
array->addTokens (values, false);
DBG(array[0]);
I’ve found this workaround, but is there a way to directly retrieve an element from a StringArray pointer?
StringArray* array = new StringArray();
String values = "1 2 3 4 5 6";
array->addTokens (values, false);
StringArray array2;
array2.addArray (*array, 0, 1);
DBG (array2[0]);