[RESOLVED] deprecated conversion from string const to char*
I am having an error after compiling the program with above warning. i believe i'm doing something wrong my code is as below. program terminates with seg fault
in main i'm calling sqlfunction.cpp to query mysql database.
timer loop dumps the result to the mysql database by querying sqlfunction.
program runs in the main ok even with the warnings. but it doesnt run in the timer loop and terminates with seg fault.????? please help what should i change in this
in main cpp
void *timer(void *arg)
{
int ret;
char command[1024];
double Myarray[3000];
while (1){
clock_t endwait;
endwait = clock() + 1 * CLOCKS_PER_SEC;
while (clock() < endwait){}//do nothing
int i = 0;
sprintf(command,"insert into meter (Voltage) values (%f);",mul); //warnign here
ret = Querydb(command,Myarray);
printf("Querydb = %d\n",ret);
printf("__________\n");
}
Bookmarks