Code:
u16 * ascii_to_mine(const char * str, const u8 len)
{
u16 * mstr = new u16[len];
u16 loop;
for (loop = 0; loop < len; loop++)
mstr[loop] = (u16)(str[loop] - 32);
}
Well, you're not returning anything, so you're doing a lot of work for nothing. So add a return at the end.
Code:
u16 * ascii_to_mine(const char * str, const u8 len)
{
u16 * mstr = new u16[len];
u16 loop;
for (loop = 0; loop < len; loop++)
mstr[loop] = (u16)(str[loop] - 32);
return mstr;
}
And I'm assuming you use len to determine the end of your new string. Otherwise you'd need an extra slot for a terminator.