#include<mysql.h>
...
..
#define DBHOST "localhost"
#define DBUSER "root"
#define DBPASS "test"
#define DBBASE "accounting"
...
...
MYSQL mysql;
...
...
...
mysql_init(&mysql);
if(!mysql_real_connect(&mysql,DBHOST,DBUSER,DBPASS,DBBASE,0,NULL,0))
{
printf("Error Connecting To Database\n");
free(truncated);
exit(1);
}
...
...
...
That's the code snippet
Oh, it's c for linux
