Code below is part of the file i have created to return result of mysql database. it works ok by it self when i print the result (check comment "print 1") but i would like to transfer this array to somewhere else. so would like this function to return me an array filled with the result some how but its not working at all
compile error: cannot convert 'double' to 'double' in return
i think i am doing very basic mistake here somewhere but cant find it
please help.
thanks for the reply b2ee. but could you please put some code in so that it can explain bit more. do you mean pass on query to Querydb? the other thing i tried was to use Querydb as an array.
Char **Querydb (char *query)
but then i had trouble inserting result comming out from row to Querydb
The most direct way is:
"
double Querydb(char *query, double arr[]);
// The other way is the below, and both way should work.
//double Querydb(char *query, double* arr);
{
....
}
"
When calling:
"
double Myarray[30000];
Querydb(query, Myarray);
"
Make sure you know the elements in row wouldn't exceed 30000.
The more suitable way is to use "vector" which is the dynamic array in C++.
Another concern, put the size 30000 arry in stack is not good habit. May be for the moderPC, there is no issue for that. Stack overflow is an obvious risk.