SDK DLL FROM C++ Help with return Array

Posted By: NeoNeper

SDK DLL FROM C++ Help with return Array - 06/01/12 13:22

Hi Guuuyyss.

I am writing a DLL to connect to mysql on the A8 Litec from C + +.

Here is my first implementations in the DLL.
This works ok

Download for Test:
LiteC_ Connector_Mysql

Files on Zip:
> libmysql.dll
> mysql_v0.1.dll
> litec_connector_ot.c

Function:

Initialize.
Connect
Return Collation type
Close Connection
///////////////////////////////////////////////////////////////////

Could someone give a help?
How do I "return" of C + + return an array? and Litec, as would be to get these values


now I need implement the functions of research in the database, and for this I will need return arrays containing the results.


Posted By: Rei_Ayanami

Re: SDK DLL FROM C++ Help with return Array - 06/01/12 13:26

If your array is static:

Code:
int *someFunction()
{

int yourarray[YOUR_ARRAY_SIZE];

return yourarray;

}



if your array is dynamic:

Code:
int *someFunction()
{

int *yourarray = new int[someSize];

return yourarray;

}



Posted By: NeoNeper

Re: SDK DLL FROM C++ Help with return Array - 06/02/12 00:30

Ohhhhhhhhh tanks man. ^^
It workkkkk!.
© 2023 lite-C Forums