I'm kinda new to C++, having programmed VB6 and VB.NET for some time.
Here's my function:
extern "C" __declspec(dllexport) long* CHARtoINT(char* input);
long* CHARtoINT(char* input)
{
int length = strlen(input);
long* output;
for (int i = 0; i < length; i++)
{
output[i] = (long)input[i];
}
return output;
}
The purpose is to pass in a string, and return a long (would prefer
int) array. I need every letter of the string that comes in to be
it's own array member in the outgoing array in ASCII equivs. For
example, if I pass into it "Hello", I need this returned:
[72],[101],[108],[108],[111]
Should be simple, but after 3 weeks, I still can't get it too work
right. I've even tried to pass a areference to the long* as a
parameter, and still no good. Ohh, BTW, this needs to be able to be
called form VB, and C++, and .NET. Nice added touch, right?
Thanks,
Tibby