How to return array from function in NXC? I tried the following
string[] strsplit(string str)
{
string parts[2] = {"1", "2"};
return parts;
}
but I get Variable name expected
. Why?
P.S. if there built-in split function I'll be glad to here about it.
string[]
cannot be a return type in C or C++, and hence NXC.See the NXC API for
SubStr()
, to help in 'splitting' strings.Try: