How to run .sql script file in c++?

c++, database, mysql

Solution

You can always use the `system` function to call the `mysql` program to do it for you.

Problem

I want to execute a script file of mysql in my code, written in c++. How i can do it ?

Original source