I have got the segmentation fault problem and I am wondering if anyone can help me.

Firstly I'm developed in C++ on a Linux machine (using g++ compiler).
I am going to develop the Visual Surveillance application using the Network Camera as a hardware.

Program No. 1:

if (mysql_query(co nn, "truncate video")) {
//fprintf(stderr, "%s\n", mysql_error(con n));
...